Skip to content

Conversation

@HQebupt
Copy link
Contributor

@HQebupt HQebupt commented Sep 15, 2022

Motivation

When the client seek a position, it will update the read posistion and mark delete position in the cursor. And meanwhile, it will persist the mark delete position to Bookie, then record the persistent mark delete position in the field persistentMarkDeletePosition.

However, The persistent mark delete position persistentMarkDeletePosition is ahead of markDeletePosition after seek , which is obviously unreasonable.

protected volatile PositionImpl markDeletePosition;
// this position is have persistent mark delete position
protected volatile PositionImpl persistentMarkDeletePosition;
protected static final AtomicReferenceFieldUpdater<ManagedCursorImpl, PositionImpl>
INPROGRESS_MARKDELETE_PERSIST_POSITION_UPDATER =
AtomicReferenceFieldUpdater.newUpdater(ManagedCursorImpl.class, PositionImpl.class,
"inProgressMarkDeletePersistPosition");

Modifications

  • Persistent the previous seek position as new persistent mark delete position into Bookie.
  • Clean up code

Verifying this change

  • Make sure that the change passes the CI checks.

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

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

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API: (no)
  • The schema: (no)
  • The default values of configurations: (no)
  • The wire protocol: (no)
  • The rest endpoints: (no)
  • The admin cli options: (no)
  • Anything that affects deployment: (no)

Documentation

Check the box below and label this PR (if you have committer privilege).

Need to update docs?

  • doc-not-needed

Matching PR in forked repository

PR in forked repository: HQebupt#6

@HQebupt HQebupt changed the title [fix][managed-ledger]persistentMarkDeletePosition is ahead of markDeletePosition in ManagedCursor when handle seek request [fix][managed-ledger]persistentMarkDeletePosition is ahead of markDeletePosition in ManagedCursor when handling seek request Sep 15, 2022
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Sep 15, 2022
…etePosition in ManagedCursor when handle seek request
@HQebupt
Copy link
Contributor Author

HQebupt commented Oct 19, 2022

@AnonHxy AnonHxy changed the title [fix][managed-ledger]persistentMarkDeletePosition is ahead of markDeletePosition in ManagedCursor when handling seek request [fix][ml]persistentMarkDeletePosition is ahead of markDeletePosition in ManagedCursor when handling seek request Oct 19, 2022
@HQebupt
Copy link
Contributor Author

HQebupt commented Nov 1, 2022

Duplicated with #18237

@HQebupt HQebupt closed this Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-not-needed Your PR changes do not impact docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants