-
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
Fix IllegalStateException in PersistentReplicator #10098
Fix IllegalStateException in PersistentReplicator #10098
Conversation
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 catch.
the change looks good to me
Do you mind adding some minimal test case that reproduces the problem ?
it is scary that we do not have any broken test.
My reasoning is that we can commit this fix as it is but, as we are not in a hurry (no need for an hotfix, as 2.8.0 is still unreleased), we can spend a little more time and add a test that covers this change.
Makes sense. It seems that integration tests are missing for replicated subscriptions (PIP-33) so it requires wider understanding of the feature to be able to add the required test coverage. @merlimat do you have recommendations of how replicated subscriptions could be tested as part of the automated tests in CI? |
I suggest to not go in the direction of integration tests. Is it possible that we do not have tests like this ? |
Makes sense. The integration test doesn't have to be under |
Fixing the IllegalStateException doesn't fix subscription replication. A new exception appears. I reported that in #10097 (comment) . |
/pulsarbot run-failure-checks |
1 similar comment
/pulsarbot run-failure-checks |
4563683
to
28faa8e
Compare
I added a test that reproduces #10054 and it also reproduced the IllegalStateException . However it didn't reproduce the IllegalReferenceCountException that I noticed when testing manually. |
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ReplicatorSubscriptionTest.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ReplicatorSubscriptionTest.java
Show resolved
Hide resolved
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
/pulsarbot run-failure-checks |
...r-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentReplicator.java
Outdated
Show resolved
Hide resolved
cca419d
to
2cb384b
Compare
/pulsarbot run-failure-checks |
4 similar comments
/pulsarbot run-failure-checks |
/pulsarbot run-failure-checks |
/pulsarbot run-failure-checks |
/pulsarbot run-failure-checks |
@sijie can you please take another look ? |
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.
👍
LightProto is not present in branch-7.2, removing release/2.7.2 label |
Fixes: #10097
Motivation
See #10097 for the issue. It seems that the code broke when the switch was made to LightProto in #9046.
Modifications
It is necessary to use
msg.getMessageBuilder().hasReplicatedFrom()
and use logic that only callsmsg.getMessageBuilder().getReplicatedFrom()
ifhasReplicatedFrom()
returns true.