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

   <!-- Either this PR fixes an issue, -->
   Fixes #17040
   
   ### Motivation
   Transaction buffer snapshot will be read to initailize transaction buffer. 
   
`org.apache.pulsar.broker.transaction.buffer.impl.SingleSnapshotAbortedTxnProcessorImpl#recoverFromSnapshot`
   <img width="535" alt="企业微信截图_830996e7-2c6e-4cc6-a062-f0ab47680dc0" 
src="https://user-images.githubusercontent.com/52550727/204694530-e7713e11-90c3-4487-8ed3-c2bc638fe9fa.png";>
   <img width="492" alt="image" 
src="https://user-images.githubusercontent.com/52550727/204694693-9f331ab6-fb8b-47c3-8e9a-da99b735f3c9.png";>
   <img width="632" alt="企业微信截图_7be78b60-bdd2-4778-aafa-2093fb970b0c" 
src="https://user-images.githubusercontent.com/52550727/204694647-3d11567d-4673-4dc7-be18-9329d2e65a12.png";>
   
   While `reader.hasMessageAvailable` do not guarantee that a subsequent call 
to `readNext()` will not block, which will result into that transaction buffer 
can't be initialized successfully. 
   
   
   ### Modifications
   use `readNextAsync` instead of `readNext`, and wait for result with timeout. 
   
   ### 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 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
   - [ ] Anything that affects deployment
   
   ### Documentation
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   - [ ] `doc` <!-- Your PR contains doc changes. Please attach the local 
preview screenshots (run `sh start.sh` at `pulsar/site2/website`) to your PR 
description, or else your PR might not get merged. -->
   - [ ] `doc-required` <!-- Your PR changes impact docs and you will update 
later -->
   - [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->
   - [ ] `doc-complete` <!-- Docs have been already added -->
   
   ### Matching PR in forked repository
   
   PR in forked repository: <!-- ENTER URL HERE -->
   
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to