-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feat][broker] Segmented transaction buffer snapshot segment and index system topic #16931
[feat][broker] Segmented transaction buffer snapshot segment and index system topic #16931
Conversation
…ngying/pip/pip196-2
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/ReadOnlyCursor.java
Outdated
Show resolved
Hide resolved
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerFactoryImpl.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java
Outdated
Show resolved
Hide resolved
.../main/java/org/apache/pulsar/broker/service/SystemTopicBaseTxnBufferSnapshotBaseService.java
Outdated
Show resolved
Hide resolved
...in/java/org/apache/pulsar/broker/service/SystemTopicBaseTxnBufferSnapshotSegmentService.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/apache/pulsar/broker/service/SystemTopicBaseTxnBufferSnapshotService.java
Outdated
Show resolved
Hide resolved
.../main/java/org/apache/pulsar/broker/service/TransactionBufferSnapshotSegmentServiceImpl.java
Outdated
Show resolved
Hide resolved
.../java/org/apache/pulsar/broker/systopic/TransactionBufferSnapshotIndexSystemTopicClient.java
Outdated
Show resolved
Hide resolved
...ava/org/apache/pulsar/broker/systopic/TransactionBufferSnapshotSegmentSystemTopicClient.java
Outdated
Show resolved
Hide resolved
.../java/org/apache/pulsar/broker/systopic/TransactionBufferSnapshotIndexSystemTopicClient.java
Outdated
Show resolved
Hide resolved
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/ManagedLedgerFactory.java
Outdated
Show resolved
Hide resolved
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ReadOnlyManagedLedgerImpl.java
Show resolved
Hide resolved
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ReadOnlyManagedLedgerImpl.java
Outdated
Show resolved
Hide resolved
...in/java/org/apache/pulsar/broker/service/SystemTopicTxnBufferSnapshotSegmentServiceImpl.java
Outdated
Show resolved
Hide resolved
...oker/src/main/java/org/apache/pulsar/broker/service/SystemTopicTxnBufferSnapshotService.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/apache/pulsar/broker/service/SystemTopicTxnBufferSnapshotBaseService.java
Outdated
Show resolved
Hide resolved
...ker/src/main/java/org/apache/pulsar/broker/service/TransactionBufferSnapshotServiceImpl.java
Outdated
Show resolved
Hide resolved
@@ -93,22 +93,22 @@ | |||
* @return message id | |||
* @throws PulsarClientException exception while write event cause | |||
*/ | |||
MessageId write(T t) throws PulsarClientException; | |||
MessageId write(T t, String key) throws PulsarClientException; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can retain write(T t), just add write(T t, String key)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, why mark this one as resolved, I don't see any conclusion for this one.
And it's better to use MessageId write(String key, T value)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because MessageId write(T t) throws PulsarClientException;
can not be implement in the TransactionBufferSnapshotBaseSystemTopicClient
.
We can not get the key from the value of type T.
.../java/org/apache/pulsar/broker/systopic/TransactionBufferSnapshotIndexSystemTopicClient.java
Outdated
Show resolved
Hide resolved
.../java/org/apache/pulsar/broker/systopic/TransactionBufferSnapshotIndexSystemTopicClient.java
Outdated
Show resolved
Hide resolved
...r-broker/src/main/java/org/apache/pulsar/broker/systopic/TopicPoliciesSystemTopicClient.java
Outdated
Show resolved
Hide resolved
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerFactoryImpl.java
Show resolved
Hide resolved
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerFactoryImpl.java
Outdated
Show resolved
Hide resolved
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/ManagedLedgerFactory.java
Outdated
Show resolved
Hide resolved
...n/java/org/apache/pulsar/broker/systopic/TransactionBufferSnapshotBaseSystemTopicClient.java
Outdated
Show resolved
Hide resolved
...n/java/org/apache/pulsar/broker/systopic/TransactionBufferSnapshotBaseSystemTopicClient.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/apache/pulsar/broker/service/TransactionBufferSnapshotServiceFactory.java
Outdated
Show resolved
Hide resolved
...oker/src/main/java/org/apache/pulsar/broker/service/SystemTopicTxnBufferSnapshotService.java
Show resolved
Hide resolved
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/TxnID.java
Outdated
Show resolved
Hide resolved
pulsar-common/src/main/java/org/apache/pulsar/common/naming/SystemTopicNames.java
Outdated
Show resolved
Hide resolved
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/ManagedLedgerFactory.java
Show resolved
Hide resolved
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerFactoryImpl.java
Outdated
Show resolved
Hide resolved
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ReadOnlyManagedLedgerImpl.java
Outdated
Show resolved
Hide resolved
...rg/apache/pulsar/broker/transaction/buffer/matadata/v2/TransactionBufferSnapshotIndexes.java
Outdated
Show resolved
Hide resolved
...rg/apache/pulsar/broker/transaction/buffer/matadata/v2/TransactionBufferSnapshotIndexes.java
Outdated
Show resolved
Hide resolved
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/TxnID.java
Outdated
Show resolved
Hide resolved
...oker/src/main/java/org/apache/pulsar/broker/service/SystemTopicTxnBufferSnapshotService.java
Show resolved
Hide resolved
@@ -93,22 +93,22 @@ | |||
* @return message id | |||
* @throws PulsarClientException exception while write event cause | |||
*/ | |||
MessageId write(T t) throws PulsarClientException; | |||
MessageId write(T t, String key) throws PulsarClientException; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, why mark this one as resolved, I don't see any conclusion for this one.
And it's better to use MessageId write(String key, T value)
.
...r-broker/src/main/java/org/apache/pulsar/broker/systopic/TopicPoliciesSystemTopicClient.java
Outdated
Show resolved
Hide resolved
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/TxnID.java
Outdated
Show resolved
Hide resolved
...n/java/org/apache/pulsar/broker/systopic/TransactionBufferSnapshotBaseSystemTopicClient.java
Outdated
Show resolved
Hide resolved
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerFactoryImpl.java
Show resolved
Hide resolved
pulsar-common/src/main/java/org/apache/pulsar/common/naming/SystemTopicNames.java
Outdated
Show resolved
Hide resolved
pulsar-common/src/main/java/org/apache/pulsar/common/naming/SystemTopicNames.java
Outdated
Show resolved
Hide resolved
pulsar-common/src/main/java/org/apache/pulsar/common/naming/SystemTopicNames.java
Outdated
Show resolved
Hide resolved
pulsar-common/src/main/java/org/apache/pulsar/common/naming/SystemTopicNames.java
Outdated
Show resolved
Hide resolved
pulsar-common/src/main/java/org/apache/pulsar/common/events/EventType.java
Outdated
Show resolved
Hide resolved
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/TxnID.java
Outdated
Show resolved
Hide resolved
...n/java/org/apache/pulsar/broker/systopic/TransactionBufferSnapshotBaseSystemTopicClient.java
Outdated
Show resolved
Hide resolved
...n/java/org/apache/pulsar/broker/systopic/TransactionBufferSnapshotBaseSystemTopicClient.java
Outdated
Show resolved
Hide resolved
...r-broker/src/main/java/org/apache/pulsar/broker/systopic/TopicPoliciesSystemTopicClient.java
Outdated
Show resolved
Hide resolved
...n/java/org/apache/pulsar/broker/systopic/TransactionBufferSnapshotBaseSystemTopicClient.java
Show resolved
Hide resolved
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerFactoryImpl.java
Show resolved
Hide resolved
@poorbarcode @congbobo184 Please help review the PR again, thanks. |
Codecov Report
@@ Coverage Diff @@
## master #16931 +/- ##
=============================================
+ Coverage 34.91% 45.91% +10.99%
- Complexity 5707 17672 +11965
=============================================
Files 607 1579 +972
Lines 53396 128705 +75309
Branches 5712 14161 +8449
=============================================
+ Hits 18644 59093 +40449
- Misses 32119 63498 +31379
- Partials 2633 6114 +3481
Flags with carried forward coverage won't be shown. Click here to find out more.
|
please modify the PR description for the new commit, then can be merged. @liangyepianzhou |
Master Issue: #16913
Motivation
Implement system topic client for snapshot segment topic and index topic to send segment snapshots or indexes.
The configuration
transactionBufferSegmentedSnapshotEnabled
is used in the Transaction Buffer to determine whichAbortedTxnProcessor
is adopted by this TB.Modification
In the new implementation of the Transaction Buffer Snapshot System topic, because the system topic that needs to be processed has changed from the original one to three with different schemes, we have added generics to the TransactionBufferSnapshotBaseSystemTopicClient class and the SystemTopicTxnBufferSnapshotService class.

And Pulsar Service maintains a factory class TransactionBufferSnapshotServiceFactory used to obtain SystemTopicTxnBufferSnapshotService.
This way, we can obtain the required System topic client through pulsarService to read and send snapshots.
Verifying this change
(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:)
Does this pull request potentially affect one of the following parts:
If
yes
was chosen, please highlight the changesDocumentation
Check the box below or label this PR directly.
Need to update docs?
doc-required
(Your PR needs to update docs and you will update later)
doc-not-needed
(Please explain why)
doc
(Your PR contains doc changes)
doc-complete
(Docs have been already added)