Skip to content

fix: restore append future position - #336

Open
RongtongJin wants to merge 1 commit into
openmessaging:masterfrom
RongtongJin:codex/restore-append-future-position
Open

fix: restore append future position#336
RongtongJin wants to merge 1 commit into
openmessaging:masterfrom
RongtongJin:codex/restore-append-future-position

Conversation

@RongtongJin

Copy link
Copy Markdown
Contributor

What changed

  • Restore the locally appended entry position on AppendFuture before returning it.
  • Add regression assertions for both single-entry and batch append futures.

Why

The append path refactor stopped propagating the appended entry position to AppendFuture, so a successful append still returned -1 from getPos(). The previous implementation set this value immediately in waitAck(), and downstream consumers such as RocketMQ use the local position before quorum completion.

For batch appends, the base future position remains the last appended entry, matching the previous behavior; all individual positions are still available through BatchAppendFuture#getPositions().

This was found while validating apache/rocketmq#10650 against the current DLedger source.

Verification

  • Regression test before the fix: the new single and batch assertions failed with expected: 0 / 6192, actual: -1.
  • Regression test after the fix: AppendAndPushTest passed (6 tests, 0 failures).
  • mvn -B -ntp -nsu -Djacoco.skip=true -DskipTests clean package: all reactor modules passed.
  • Full reactor tests were attempted, but this machine's data volume reached DLedger's 0.95 disk-full threshold. The same 415 DISK_FULL failure was reproduced on an unmodified origin/master worktree, so it is unrelated to this change.

@RongtongJin
RongtongJin marked this pull request as ready for review August 13, 2026 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant