You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 16, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 16, 2026. It is now read-only.
Describe the bug
The offset of kakfa map to messageId of pulsar by splitting 64 bits (a long type) to three parts, 20 bits for ledgerId , 32 bits for entryId and 12 bits for batchIndex , therefor, ledgerId can't be larger than (2^19 - 1) since long type is signed.
If we have lost of topics or partitions, ledgerId will be overflow very soon.
Besides, entryId has 32 bits, but pulsar ledger will rollover for every 50000 entries by default. Most of entryId space will waste if ledger rolled .
In my opinion, we should re-assign the bits for ledgerId and entryId to make kop have enough range for ledgerId . I have redistribute the ledgerId with 35 bits, entryId with 17 bits and batchIndex with 12 bits. @sijie@jiazhai Is there any better way to resolve this problem ? Any suggestions will be appreciated.
In my opinion, we should re-assign the bits for ledgerId and entryId to make kop have enough range for ledgerId . I have redistribute the ledgerId with 35 bits, entryId with 17 bits and batchIndex with 12 bits.
This approach looks good to me. But we need to figure out a plan for backward compatibility.
Alternatively, we should introduce a "sequence" in the Pulsar topic. A sequence is a monotonically increasing long number. This would ensure we have enough bits. If you are interested in contributing to this feature, we can discuss a PIP for Pulsar.
Alternatively, we should introduce a "sequence" in the Pulsar topic. A sequence is a monotonically increasing long number. This would ensure we have enough bits.
It's great idea that if we can map kafka offset to a long type sequence.
I have talked about this with @jiazhai roughly before. We can talk about some details first.
Activity
sijie commentedon Aug 20, 2020
@aloyszhang
This approach looks good to me. But we need to figure out a plan for backward compatibility.
Alternatively, we should introduce a "sequence" in the Pulsar topic. A sequence is a monotonically increasing long number. This would ensure we have enough bits. If you are interested in contributing to this feature, we can discuss a PIP for Pulsar.
jiazhai commentedon Aug 21, 2020
👍, We could find a time to discuss a PIP.
aloyszhang commentedon Aug 21, 2020
@sijie @jiazhai
It's great idea that if we can map kafka
offsetto a long typesequence.I have talked about this with @jiazhai roughly before. We can talk about some details first.
Ignore the flaky MultiLedgerTest.testListOffsetForEmptyRolloverLedger (…
Ignore the flaky MultiLedgerTest.testListOffsetForEmptyRolloverLedger (…