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
When performing a write operation to a single ledger in Pulsar, the KoP interceptor calls intercepter.beforeAddEntry() before the write completes, which increments the broker’s index for the corresponding ledger. For example, request A calls this method and gets index1, which is then written into the entry. If request B arrives concurrently, it also calls intercepter.beforeAddEntry() and gets index2, which is written into the entry.
The issue arises when request A fails and its indexGenerator is rolled back, but request B’s write operation succeeds, meaning the entry for request B still contains the incorrect index2. Furthermore, if a subsequent request C is processed and its index index3 turns out to be smaller than index2, the brokerIndex in entries within the same ledger will no longer be strictly increasing. This non-monotonic sequence can lead to unexpected behavior in KoP when performing binary searches for the entry corresponding to a given offset. This issue requires further investigation to ensure that ledger entries maintain a correct monotonically increasing index even in scenarios where write operations fail and rollbacks occur.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
When performing a write operation to a single ledger in Pulsar, the KoP interceptor calls intercepter.beforeAddEntry() before the write completes, which increments the broker’s index for the corresponding ledger. For example, request A calls this method and gets index1, which is then written into the entry. If request B arrives concurrently, it also calls intercepter.beforeAddEntry() and gets index2, which is written into the entry.
The issue arises when request A fails and its indexGenerator is rolled back, but request B’s write operation succeeds, meaning the entry for request B still contains the incorrect index2. Furthermore, if a subsequent request C is processed and its index index3 turns out to be smaller than index2, the brokerIndex in entries within the same ledger will no longer be strictly increasing. This non-monotonic sequence can lead to unexpected behavior in KoP when performing binary searches for the entry corresponding to a given offset. This issue requires further investigation to ensure that ledger entries maintain a correct monotonically increasing index even in scenarios where write operations fail and rollbacks occur.
Beta Was this translation helpful? Give feedback.
All reactions