pulsar icon indicating copy to clipboard operation
pulsar copied to clipboard

[fix] [txn] Get previous position by managed ledger.

Open thetumbled opened this issue 1 year ago • 0 comments

Motivation

Max read position is before the first ongoing txn's position. But the entry id of the first message may be 0, calculate the max read position by entry id - 1 is unsafe.

Modifications

Calculate the max read position by method managedLedger.getPreviousPosition.

Verifying this change

  • [x] Make sure that the change passes the CI checks.

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • [ ] Dependencies (add or upgrade a dependency)
  • [ ] The public API
  • [ ] The schema
  • [ ] The default values of configurations
  • [ ] The threading model
  • [ ] The binary protocol
  • [ ] The REST endpoints
  • [ ] The admin CLI options
  • [ ] The metrics
  • [ ] Anything that affects deployment

Documentation

  • [ ] doc
  • [ ] doc-required
  • [x] doc-not-needed
  • [ ] doc-complete

Matching PR in forked repository

PR in forked repository: https://github.com/thetumbled/pulsar/pull/42

thetumbled avatar Feb 05 '24 08:02 thetumbled