You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/04/14 07:18:11 UTC

[GitHub] [pulsar] congbobo184 opened a new pull request #10224: [Transaction] Fix transaction log recover sequenceId problem.

congbobo184 opened a new pull request #10224:
URL: https://github.com/apache/pulsar/pull/10224


   ## Motivation
   now recover transaction log can't get the correct sequenceID. cursor will ack the ```lastConfirmEntry```.
   ## implement
   1. change recover the sequenceID by getting ```lastConfirmEntry```.
   2. when the ledger have been deleted, store the max sequenceID in ```managedLedger``` properties.
   ### Verifying this change
   Add the tests for it
   
   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)
   
   


-- 
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.

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



[GitHub] [pulsar] codelipenghui commented on a change in pull request #10224: [Transaction] Fix transaction log recover sequenceId problem.

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on a change in pull request #10224:
URL: https://github.com/apache/pulsar/pull/10224#discussion_r617177349



##########
File path: managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java
##########
@@ -586,6 +588,47 @@ public void asyncReadEntries(int numberOfEntriesToRead, long maxSizeBytes, ReadE
         ledger.asyncReadEntries(op);
     }
 
+    public CompletableFuture<Entry> readSpecifyPositionByPosition(PositionImpl position) {

Review comment:
       We already have a method `asyncReadEntry` in the ManagedLedgerImpl, it's better to use the current implementation directly.




-- 
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.

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



[GitHub] [pulsar] codelipenghui merged pull request #10224: [Transaction] Fix transaction log recover sequenceId problem.

Posted by GitBox <gi...@apache.org>.
codelipenghui merged pull request #10224:
URL: https://github.com/apache/pulsar/pull/10224


   


-- 
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.

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



[GitHub] [pulsar] codelipenghui commented on a change in pull request #10224: [Transaction] Fix transaction log recover sequenceId problem.

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on a change in pull request #10224:
URL: https://github.com/apache/pulsar/pull/10224#discussion_r615606887



##########
File path: managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java
##########
@@ -586,6 +588,48 @@ public void asyncReadEntries(int numberOfEntriesToRead, long maxSizeBytes, ReadE
         ledger.asyncReadEntries(op);
     }
 
+    public CompletableFuture<Entry> readLastConfirmEntry() {

Review comment:
       You can use `getLastPosition()` method of the ManagedLedger directly.




-- 
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.

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



[GitHub] [pulsar] codelipenghui commented on a change in pull request #10224: [Transaction] Fix transaction log recover sequenceId problem.

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on a change in pull request #10224:
URL: https://github.com/apache/pulsar/pull/10224#discussion_r613994619



##########
File path: pulsar-transaction/coordinator/src/main/proto/PulsarTransactionMetadata.proto
##########
@@ -50,4 +50,5 @@ message TransactionMetadataEntry {
   optional uint64 timeout_ms      = 8;
   optional uint64 start_time      = 9;
   optional uint64 last_modification_time = 10;
+  optional uint64 max_sequence_id = 11;

Review comment:
       Is it better to use max_local_txn_id




-- 
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.

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