-
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
[improve][broker] Fix non-persistent system topic schema compatibility #23286
base: master
Are you sure you want to change the base?
[improve][broker] Fix non-persistent system topic schema compatibility #23286
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #23286 +/- ##
============================================
+ Coverage 73.57% 74.54% +0.97%
- Complexity 32624 34305 +1681
============================================
Files 1877 1928 +51
Lines 139502 145035 +5533
Branches 15299 15859 +560
============================================
+ Hits 102638 108122 +5484
+ Misses 28908 28652 -256
- Partials 7956 8261 +305
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
@Demogorgon314
The fix looks good. But I still have concern about the compatibility.
- We have added
systemTopicSchemaCompatibilityStrategy=ALWAYS_COMPATIBLE
which is not by original design, because we don't have another way to resolve the compatibility issue. - Even if we use
ALWAYS_COMPATIBLE
, that doesn't means we will ok for any data format change
So, I would like to suggest to add a real compatibility test for different version of data. For the code part, we should not remove the old format data struct directly. Instead, we can create v1, v2 ..., then we can test that we can publish data from v1, v2 and consume by v(latest), and vice versa.
@codelipenghui Did you mean to set the |
NonPersistentSystemTopic topic = new NonPersistentSystemTopic(topicName, pulsar.getBrokerService()); | ||
Assert.assertEquals(SchemaCompatibilityStrategy.ALWAYS_COMPATIBLE, topic.getSchemaCompatibilityStrategy()); | ||
|
||
var brokerLoadDataStore = LoadDataStoreFactory.create(pulsar, topicName, BrokerLoadDataV1.class); |
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.
@codelipenghui I have added a test to cover the BrokerLoadData
format change.
dfcb47a
to
446c066
Compare
Motivation
When upgrading broker version from
3.0.x
to3.3.x
withExtensibleLoadManagerImpl
enabled, it will have anUnable to read schema
exception. And the broker will fail to start. This issue is caused by #22055 .Modifications
Add a new class
NonPersistentSystemTopic
, and it will use for system non-persistent topic.Documentation
doc
doc-required
doc-not-needed
doc-complete