[Broker] Always let system topic TRANSACTION_BUFFER_SNAPSHOT be auto created - #10876
Merged
merlimat merged 3 commits intoJun 10, 2021
Merged
Conversation
Member
Author
|
@congbobo184 @codelipenghui @sijie @merlimat - PTAL. I am not familiar with the intricacies of the transaction code base within the brokers, but I think this change should fix the issue that @eolivelli discovered in #10871. |
Member
Author
|
/pulsarbot run-failure-checks |
eolivelli
previously requested changes
Jun 9, 2021
eolivelli
left a comment
Contributor
There was a problem hiding this comment.
looks good
please add an unit test
eolivelli
requested review from
codelipenghui,
congbobo184,
gaoran10 and
merlimat
June 9, 2021 21:33
Member
Author
|
@eolivelli - done. I didn't see a good way to test the other usages of the |
merlimat
approved these changes
Jun 10, 2021
merlimat
dismissed
eolivelli’s stale review
June 10, 2021 04:57
The unit test was added. Merging now to include in 2.8 rc3
Contributor
|
LGTM it would be great to have a new 2.8.0rc3 |
eolivelli
pushed a commit
to datastax/pulsar
that referenced
this pull request
Jun 14, 2021
…created (apache#10876) * Always let system topic TRANSACTION_BUFFER_SNAPSHOT be auto created * Remove unused import * Add EVENTS_TOPIC_NAMES set; add unit tests (cherry picked from commit b1b3b3c) (cherry picked from commit e44be07)
yangl
pushed a commit
to yangl/pulsar
that referenced
this pull request
Jun 23, 2021
…created (apache#10876) * Always let system topic TRANSACTION_BUFFER_SNAPSHOT be auto created * Remove unused import * Add EVENTS_TOPIC_NAMES set; add unit tests
bharanic-dev
pushed a commit
to bharanic-dev/pulsar
that referenced
this pull request
Mar 18, 2022
…created (apache#10876) * Always let system topic TRANSACTION_BUFFER_SNAPSHOT be auto created * Remove unused import * Add EVENTS_TOPIC_NAMES set; add unit tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #10871
Motivation
From the linked issue:
The
TRANSACTION_BUFFER_SNAPSHOTtopic is a system topic, and it should be auto created as needed.Modifications
isAllowAutoTopicCreationmethod to ensure thatTRANSACTION_BUFFER_SNAPSHOTis considered a system topic.checkTopicIsEventsNamesto take aTopicNameand then check for equality in stead of checkendsWith. That could have technically led to unexpected behavior if the topic name was something likemy__change_eventsormy__transaction_buffer_snapshot.isSystemTopicEnabledfirst to prevent potentially unnecessary string equality checks.Verifying this change
This is a simple fix that has limit impact. We'll want to verify that the logic is correct regarding allowing
TRANSACTION_BUFFER_SNAPSHOTto be auto created. Otherwise, there should be tests covering the uses of thischeckTopicIsEventsNamesmethod.Note that this change will impact the
PersistentTopicand thePersistentSubscriptionclasses. Based on reading through the usage of thecheckTopicIsEventsNamesmethod, I think this is the right change for those classes. Here are the affected usages:pulsar/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
Lines 317 to 330 in 85a60b0
pulsar/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentSubscription.java
Lines 143 to 151 in 85a60b0
Does this pull request potentially affect one of the following parts:
If
yeswas chosen, please highlight the changesDocumentation
I don't think we need new documentation for this, but if someone more familiar with transactions wants docs, please let me know where I can add docs.