-
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
Issue 15750: PIP-105: Store Subscription properties #15757
Conversation
@eolivelli:Thanks for your contribution. For this PR, do we need to update docs? |
Even if we are changing some .proto file I believe that we can cherry-pick this change to branch-2.10, in order to unblock PIP-105. This feature wasn't working, so we are not going to break anything. |
9d125d1
to
c7be86a
Compare
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.
How do the consumers change the subscription properties?
The change looks like the properties will not change after the cursor is created.
The previous behavior is the subscription will apply the properties from the first connected consumer.
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, couple of nitpicks.
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java
Show resolved
Hide resolved
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
Show resolved
Hide resolved
You are right. Honestly I don't like that much that behavior and I would prefer to let the user modify the properties using an explicit PulsarAdmin function (see #15751 ) @codelipenghui do you know why we allowed to override the properties from the first Consumer? |
@codelipenghui I have updated this patch. |
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 updated the patch.
@dlg99 At the moment I have used the same utilities used in the files, I believe that we should decide the overall style for the things you suggested and apply the changes globally
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 work!
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java
Outdated
Show resolved
Hide resolved
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java
Outdated
Show resolved
Hide resolved
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java
Show resolved
Hide resolved
.../src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentSubscription.java
Outdated
Show resolved
Hide resolved
...broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentSubscription.java
Outdated
Show resolved
Hide resolved
@codelipenghui do you know why we allowed to override the properties from the first Consumer? Hmm, I'm thinking more about it. The correct behavior should not be the first consumer override the properties, it should be "if the subscription absents, the first consumer will trigger the subscription creation, so the subscription will create with the properties that the first consumer has". The initial position also follows this way. So it should be the initial implementation of PIP-105 missed to persist the properties, causing the "first consumer override properties" |
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/ManagedCursor.java
Outdated
Show resolved
Hide resolved
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/ManagedLedger.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
Outdated
Show resolved
Hide resolved
@nicoloboschi @codelipenghui I have addressed your comments, PTAL @codelipenghui I think it is better to not change the behaviour for this patch |
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
514cbc5
to
2e06583
Compare
@codelipenghui , as discussed offline, I have changed the behavior of subscription properties, now they are like "initial position". You can set them only at creation time. |
/pulsarbot rerun-failure-checks |
b200b02
to
72430a7
Compare
/pulsar-bot rerun-failure-checks |
/pulsarbot rerun-failure-checks |
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.
I added a question about thread safety.
...broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentSubscription.java
Show resolved
Hide resolved
/pulsarbot rerun-failure-checks |
7c056d7
to
203726c
Compare
/pulsarbot rerun-failure-checks |
203726c
to
f354f0d
Compare
/pulsarbot rerun-failure-checks |
f354f0d
to
e6a67d4
Compare
/pulsarbot rerun-failure-checks |
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. Good work @eolivelli
/pulsar-bot rerun-failure-checks |
1 similar comment
/pulsar-bot rerun-failure-checks |
* PIP-105: Store Subscription properties (cherry picked from commit 23f46a0)
Fixes #15750
Motivation
The Subscription properties are not properly stored on MetadataService
Modifications
Store the subscription properties on the MetadataService (ManagedCursorInfo)
Verifying this change
This change is already covered by existing tests, I have only added some additional assertions