congbobo184 opened a new pull request #9490:
URL: https://github.com/apache/pulsar/pull/9490
## Motivation
Transaction buffer snapshot to recover ongoing and abort transaction.
## implement
snapshot metadata:
```
message AbortTxnMetadata {
optional uint64 txnid_least_bits = 1;
optional uint64 txnid_most_bits = 2;
required uint64 ledgerId = 3;
required uint64 entryId = 4;
}
message TransactionBufferSnapshot {
optional string topic_name = 1;
optional uint64 max_read_position_ledgerId = 2;
optional uint64 max_read_position_entryId = 3;
repeated AbortTxnMetadata abort_txn_metadata = 4;
}
```
- now only sore the max read position and aborts transaction, follow-up will
store ongoing txns.
- implement this by a namespace event topic. `__transaction_buffer_snapshot`
- add `transactionBufferTakeSnapshotIntervalNumber` and
`transactionBufferTakeSnapshotIntervalTime` to control taking snapshot
- add `SystemTopicBaseTxnBufferSnapshotService` to create take snapshot
`Writer` and `Reader` and cache the same namespace client.
### 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: (yes)
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:
[email protected]