[transaction] Producer state manager snapshot recovery - Part-1: Add snapshot I/O buffer #1906
[transaction] Producer state manager snapshot recovery - Part-1: Add snapshot I/O buffer #1906
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1906 +/- ##
============================================
- Coverage 18.76% 18.35% -0.41%
- Complexity 742 743 +1
============================================
Files 185 190 +5
Lines 13266 13584 +318
Branches 1213 1257 +44
============================================
+ Hits 2490 2494 +4
- Misses 10594 10909 +315
+ Partials 182 181 -1
|
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.
LGTM
@BewareMyPower Can you help take a look at this PR? |
.../streamnative/pulsar/handlers/kop/storage/PulsarTopicProducerStateManagerSnapshotBuffer.java
Show resolved
Hide resolved
/** | ||
* Use memory to store the latest snapshot. | ||
*/ | ||
public class MemoryProducerStateManagerSnapshotBuffer implements ProducerStateManagerSnapshotBuffer { |
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.
We should remove this class and related tests. Because it is only used in tests, which is meaningless.
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.
Here is a similar example: #1805
There is no bug with MemorySchemaStorage
because it's protected by tests. However, it is never used out of tests. PulsarSchemaStorage
is actually and always used and it's buggy.
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
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.
Good point, addressed.
…snapshot I/O buffer (#1906) This PR is a part of the Producer state manager snapshot recovery implementation, it cherry-picks from datastax/starlight-for-kafka#29. ### Motivation Introduce the `ProducerStateManagerSnapshotBuffer`. It can write and read the latest snapshot from a specified topic. This PR introduces two different `ProducerStateManagerSnapshotBuffer` implementations: * `PulsarTopicProducerStateManagerSnapshotBuffer`: Store the snapshot into the topic. * `PulsarPartitionedTopicProducerStateManagerSnapshotBuffer` : Store the snapshot in a partitioned topic. ### Modifications * Introduce `ProducerStateManagerSnapshotBuffer` interface. * Provide two diffident implementations for `ProducerStateManagerSnapshotBuffer`. * Add units test to cover the `Buffer`. (cherry picked from commit a6eb7a6)
…snapshot I/O buffer (#1906) This PR is a part of the Producer state manager snapshot recovery implementation, it cherry-picks from datastax/starlight-for-kafka#29. ### Motivation Introduce the `ProducerStateManagerSnapshotBuffer`. It can write and read the latest snapshot from a specified topic. This PR introduces two different `ProducerStateManagerSnapshotBuffer` implementations: * `PulsarTopicProducerStateManagerSnapshotBuffer`: Store the snapshot into the topic. * `PulsarPartitionedTopicProducerStateManagerSnapshotBuffer` : Store the snapshot in a partitioned topic. ### Modifications * Introduce `ProducerStateManagerSnapshotBuffer` interface. * Provide two diffident implementations for `ProducerStateManagerSnapshotBuffer`. * Add units test to cover the `Buffer`. (cherry picked from commit a6eb7a6)
…snapshot I/O buffer (streamnative#1906) This PR is a part of the Producer state manager snapshot recovery implementation, it cherry-picks from datastax/starlight-for-kafka#29. ### Motivation Introduce the `ProducerStateManagerSnapshotBuffer`. It can write and read the latest snapshot from a specified topic. This PR introduces two different `ProducerStateManagerSnapshotBuffer` implementations: * `PulsarTopicProducerStateManagerSnapshotBuffer`: Store the snapshot into the topic. * `PulsarPartitionedTopicProducerStateManagerSnapshotBuffer` : Store the snapshot in a partitioned topic. ### Modifications * Introduce `ProducerStateManagerSnapshotBuffer` interface. * Provide two diffident implementations for `ProducerStateManagerSnapshotBuffer`. * Add units test to cover the `Buffer`. (cherry picked from commit a6eb7a6)
This PR is a part of the Producer state manager snapshot recovery implementation, it cherry-picks from datastax/starlight-for-kafka#29.
Motivation
Introduce the
ProducerStateManagerSnapshotBuffer
.It can write and read the latest snapshot from a specified topic.
This PR introduces two different
ProducerStateManagerSnapshotBuffer
implementations:PulsarTopicProducerStateManagerSnapshotBuffer
: Store the snapshot into the topic.PulsarPartitionedTopicProducerStateManagerSnapshotBuffer
: Store the snapshot in a partitioned topic.Modifications
ProducerStateManagerSnapshotBuffer
interface.ProducerStateManagerSnapshotBuffer
.Buffer
.Documentation
Check the box below.
Need to update docs?
doc-required
(If you need help on updating docs, create a doc issue)
no-need-doc
(Please explain why)
doc
(If this PR contains doc changes)