Repository navigation
Closed
Labels
type/bugThe PR fixed a bug or issue reported a bug
Description
Search before asking
- I searched in the issues and found nothing similar.
Version
2.11.3 to 3.1.0
Minimal reproduce step
N/A
What did you expect to see?
No error
What did you see instead?
After bumped I got a lot of exceptions as:
2023-10-23T15:01:29,964+0000 [BookKeeperClientWorker-OrderedExecutor-7-0] INFO org.apache.bookkeeper.client.PendingReadOp - Mac mismatch while reading L16702 E0 from bookie: yo-bookkeeper-c3-n3
2023-10-23T15:01:29,965+0000 [BookKeeperClientWorker-OrderedExecutor-7-0] ERROR org.apache.bookkeeper.client.PendingReadOp - Read of ledger entry failed: L16702 E0-E0, Sent to [yo-bookkeeper-c3-n14, yo-bookkeeper-c3-n3, yo-bookkeeper-c3-n7], Heard from [yo-bookkeeper-c3-n14, yo-bookkeeper-c3-n3, yo-bookkeeper-c3-n7] : bitset = {0, 1, 2}, Error = 'Entry digest does not match'. First unread entry is (-1, rc = null)
2023-10-23T15:01:29,966+0000 [main] ERROR org.apache.bookkeeper.client.BookKeeperAdmin - Error reading entry 0 from ledger 16702
org.apache.bookkeeper.client.BKException$BKDigestMatchException: Entry digest does not match
at org.apache.bookkeeper.client.SyncCallbackUtils.finish(SyncCallbackUtils.java:83) ~[org.apache.bookkeeper-bookkeeper-server-4.16.2.jar:4.16.2]
at org.apache.bookkeeper.client.SyncCallbackUtils$SyncReadCallback.readComplete(SyncCallbackUtils.java:229) ~[org.apache.bookkeeper-bookkeeper-server-4.16.2.jar:4.16.2]
at org.apache.bookkeeper.client.LedgerHandle$4.onFailure(LedgerHandle.java:818) ~[org.apache.bookkeeper-bookkeeper-server-4.16.2.jar:4.16.2]
at org.apache.bookkeeper.common.concurrent.FutureEventListener.accept(FutureEventListener.java:38) ~[org.apache.bookkeeper-bookkeeper-common-4.16.2.jar:4.16.2]
at org.apache.bookkeeper.common.concurrent.FutureEventListener.accept(FutureEventListener.java:26) ~[org.apache.bookkeeper-bookkeeper-common-4.16.2.jar:4.16.2]
at java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:863) ~[?:?]
at java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:841) ~[?:?]
at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482) ~[?:?]
at org.apache.bookkeeper.common.util.SingleThreadExecutor.safeRunTask(SingleThreadExecutor.java:137) ~[org.apache.bookkeeper-bookkeeper-common-4.16.2.jar:4.16.2]
at org.apache.bookkeeper.common.util.SingleThreadExecutor.run(SingleThreadExecutor.java:107) ~[org.apache.bookkeeper-bookkeeper-common-4.16.2.jar:4.16.2]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[io.netty-netty-common-4.1.94.Final.jar:4.1.94.Final]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
org.apache.pulsar.broker.service.schema.exceptions.SchemaException: Entry digest does not match - ledger=103622248 - operation=Failed to read entry - entry=0
at org.apache.pulsar.broker.service.schema.BookkeeperSchemaStorage.bkException(BookkeeperSchemaStorage.java:711)
at org.apache.pulsar.broker.service.schema.BookkeeperSchemaStorage$Functions.lambda$getLedgerEntry$0(BookkeeperSchemaStorage.java:655)
at org.apache.bookkeeper.client.LedgerHandle$4.onFailure(LedgerHandle.java:818)
at org.apache.bookkeeper.common.concurrent.FutureEventListener.accept(FutureEventListener.java:38)
at org.apache.bookkeeper.common.concurrent.FutureEventListener.accept(FutureEventListener.java:26)
at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:863)
at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:841)
at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482)
at org.apache.bookkeeper.common.util.SingleThreadExecutor.safeRunTask(SingleThreadExecutor.java:137)
at org.apache.bookkeeper.common.util.SingleThreadExecutor.run(SingleThreadExecutor.java:107)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:833)
Anything else?
No response
Are you willing to submit a PR?
- I'm willing to submit a PR!
Reacted by Collignon-Ducret Rémi
Metadata
Metadata
Assignees
Labels
type/bugThe PR fixed a bug or issue reported a bug
Activity
[-][Bug] [/-][+][Bug] Bookkeeper returns Mac mismatch while reading[/+][-][Bug] Bookkeeper returns Mac mismatch while reading[/-][+][Bug] Bookkeeper returns mac mismatch while reading[/+]KannarFr commentedon Oct 23, 2023
I'm rollbacking brokers (only) to 2.11.
EDIT: It fixed the issue. So there is an issue with rendering on the client side on v2.11+.
KannarFr commentedon Oct 23, 2023
A bit more context
Where
Read of ledger entry failed: L**103556923** E0-E0really looks like trying to read an empty ledger.miton18 commentedon Oct 26, 2023
We hit the same errors on Pulsar v3.0.1
hangc0276 commentedon Oct 26, 2023
@miton18 Do you have any way to reproduce this issue?
miton18 commentedon Oct 26, 2023
sadly, no
It happens when upgrading brokers to v3.x.x
hangc0276 commentedon Oct 26, 2023
Only upgrade broker, doesn't upgrade the bookie, right?
miton18 commentedon Oct 26, 2023
bookies has been upgraded to v3.1.0 without issues
miton18 commentedon Oct 26, 2023
ok, trying to read a ledger from bookkeeper itself also throw the same error...
023-10-26T09:40:26,062+0000 [main] INFO org.apache.bookkeeper.tools.cli.commands.client.LedgerMetaDataCommand - LedgerMetadata{formatVersion=3, ensembleSize=5, writeQuorumSize=3, ackQuorumSize=3, state=CLOSED, length=8336, lastEntryId=0, digestType=CRC32C, password=base64:, ensembles={0=[yo-bookkeeper-c3-n12, yo-bookkeeper-c3-n8, yo-bookkeeper-c3-n14, yo-bookkeeper-c3-n6, yo-bookkeeper-c3-n3]}, customMetadata={component=base64:c2NoZW1h, application=base64:cHVsc2Fy, pulsar/schemaId=base64:b3JnYV8yMWQ3ZjZkMy04Mzk3LTQ3ODItOWE2NS05MWVjYWMxYTQ1OTUvbG9ncy9fX2NoYW5nZV9ldmVudHM=}}
KannarFr commentedon Oct 30, 2023
Looks fixed in 3.1.1.
lhotari commentedon Nov 9, 2023
There are some reports on Pulsar Slack that this issue happens when
bookkeeperUseV2WireProtocol=falseor TLS is enabled for Bookkeeper. @hangc0276 I wonder what the possible bug fix has been if this is already fixed?Debashish-Mallick commentedon Nov 14, 2023
@KannarFr Have you checked with 3.0.XX version. Basically Its working, if we set bookkeeperUseV2WireProtocol=true in broker configmap.
KannarFr commentedon Nov 14, 2023
No, I didn't but should I use v2 (legacy) wire proto? I mean this can fix the issue, but this is a jump in the past, nope? :D
7 remaining items
lhotari commentedon Jan 29, 2024
Reopening until latest concerns about other checksum related bugs in BK are resolved.
lhotari commentedon Mar 29, 2024
Pending fix in Bookkeeper will be included in 4.16.5 release.
apache/bookkeeper#4196
pqab commentedon Apr 10, 2024
We are using 4.16.3 and encountering this error with 1-2 events occurring randomly on a daily basis, and we have a workaround to skip the specific position and resend the data to recover it. May I know if you are aware of any other workarounds available before the 4.16.5 release?
lhotari commentedon Apr 11, 2024
@pqab I'm not aware of a workaround. There's also a concern that there are some other problems (#22103 with some linked BK issue) that cause similar symptoms.
BK 4.16.5 has been released and there's PR to upgrade in Pulsar, #22484. This will be included in Pulsar releases 3.0.5 and 3.2.3 . ETA for the release is within a few weeks. In the meantime, it's possible to build custom builds of Pulsar.
lhotari commentedon May 28, 2024
I believe that this issue is a duplicate of #22601. I have made a fix to bookkeeper which fixes the issue: apache/bookkeeper#4404
dao-jun commentedon Jun 23, 2025
The issue still exists in 3.0.12
lhotari commentedon Jun 23, 2025
@dao-jun Is this with a cluster that was upgraded? Already corrupted entries won't get fixed, so it's possible to get the exception even if the actual root cause has been fixed.
dao-jun commentedon Jun 23, 2025
@lhotari We set TTL and Retention for the cluster and it retains 1 day message data. We upgraded Pulsar/Bookkeeper from 3.0.11 to 3.0.12 more than a week, but the broker keeps printing
Digest mismatch for ledger-id: 6545801, entry-id: 5971lhotari commentedon Jun 23, 2025
@dao-jun does this happen with new entries? there's another issue #22906 which is about Pulsar not being able to recover after a corrupted entry.
lhotari commentedon Jun 23, 2025
@dao-jun do you happen to set
managedLedgerAddEntryTimeoutSecondsin your broker.conf? My concern is that there could be something that could cause entry corruption in that case, but I haven't verified it (related comments: #24411 (comment)).dao-jun commentedon Jun 24, 2025
@lhotari Yes, we set
managedLedgerAddEntryTimeoutSecondsto 30s.Interesting, it seems that there has a bug in the feature?
lhotari commentedon Jun 24, 2025
@dao-jun It would be useful to file a new GitHub issue. Please do so.
The problem reminds of issues that I faced in #10738/#10755 along time ago. The problem is most likely different, but that might give some ideas of ways to reproduce the issue.
Do you get any sign of
IllegalReferenceCountExceptionin logs as a result of double releasing buffers?Do you happen to have a ManagedLedgerInterceptor configured?
I found #22221 related to
managedLedgerAddEntryTimeoutSeconds. Perhaps that also gives some ideas how to reproduce and what could go wrong.When looking at the code, I think I see multiple concerns in the
OpAddEntry.runmethod and using timeouts.It seems that the
currentLedgerTimeoutTriggeredsolution added in #22221 is incomplete.I don't see how things could work properly when
managedLedgerAddEntryTimeoutSecondsis enabled. We can continue to discuss that on the new GitHub issue.dao-jun commentedon Jun 25, 2025
@lhotari I created a new issue and I will reply you there
#24464