You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "Denovo1998 (via GitHub)" <gi...@apache.org> on 2026/06/30 12:43:27 UTC

[PR] [fix][broker] Prevent completing replicated snapshot before marker publish [pulsar]

Denovo1998 opened a new pull request, #26119:
URL: https://github.com/apache/pulsar/pull/26119

   ### Motivation
   
   Replicated subscription snapshots are currently marked as completed immediately after publishing the final snapshot marker. However, marker publishing on persistent topics completes asynchronously, so the final marker may still fail after the snapshot has already been removed from the pending map and recorded as the last completed snapshot.
   
   When this happens, the existing timeout-based retry path cannot recover because the snapshot is no longer pending.
   
   ### Modifications
   
   - Add a marker publishing path that exposes the publish callback result as a `CompletableFuture`.
   - Complete replicated subscription snapshots only after the final snapshot marker is successfully published.
   - Keep the snapshot pending when final marker publishing fails, allowing the existing timeout retry logic to handle it.
   - Avoid completing snapshots that have already been removed from the pending map.
   - Add a regression test that simulates final marker publish failure and verifies the snapshot remains pending.
   - Update snapshot builder tests to use the new callback-aware marker publishing path.
   
   ### 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.
   
   *(or)*
   
   This change is already covered by existing tests, such as *(please describe tests)*.
   
   *(or)*
   
   This change added tests and can be verified as follows:
   
   *(example:)*
     - *Added integration tests for end-to-end deployment with large payloads (10MB)*
     - *Extended integration test for recovery after broker failure*
   
   ### Does this pull request potentially affect one of the following parts:
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   *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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [fix][broker] Prevent completing replicated snapshot before marker publish [pulsar]

Posted by "Denovo1998 (via GitHub)" <gi...@apache.org>.
Denovo1998 commented on PR #26119:
URL: https://github.com/apache/pulsar/pull/26119#issuecomment-5078409074

   @lhotari 
   To ensure everything is in order, I have just reviewed it again.
   
   I can find the merged PRs directly related to the replicated-subscription snapshot since last time, mainly #26234. However, they appear to be complementary.
   
   It should be fine, just check after the CI passes.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [fix][broker] Prevent completing replicated snapshot before marker publish [pulsar]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari merged PR #26119:
URL: https://github.com/apache/pulsar/pull/26119


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org