-
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] [broker] Expire messages according to ledger close time to avoid client clock skew #21940
Conversation
[fix][test]Fix resource not close after method
...rc/main/java/org/apache/pulsar/broker/service/persistent/PersistentMessageExpiryMonitor.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/apache/pulsar/broker/service/persistent/PersistentMessageExpiryMonitor.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/apache/pulsar/broker/service/persistent/PersistentMessageExpiryMonitor.java
Outdated
Show resolved
Hide resolved
Regarding the PR title, I think we can change it to [fix] [broker] Expire messages according to ledger close time to avoid client clock skew |
...rc/main/java/org/apache/pulsar/broker/service/persistent/PersistentMessageExpiryMonitor.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentMessageFinderTest.java
Show resolved
Hide resolved
...rc/main/java/org/apache/pulsar/broker/service/persistent/PersistentMessageExpiryMonitor.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentMessageFinderTest.java
Outdated
Show resolved
Hide resolved
It looks like related to this change?
I have re-triggered the test. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #21940 +/- ##
============================================
+ Coverage 73.59% 73.63% +0.03%
- Complexity 32417 32486 +69
============================================
Files 1861 1863 +2
Lines 138678 138839 +161
Branches 15188 15222 +34
============================================
+ Hits 102060 102228 +168
+ Misses 28715 28710 -5
+ Partials 7903 7901 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
|
...rc/main/java/org/apache/pulsar/broker/service/persistent/PersistentMessageExpiryMonitor.java
Outdated
Show resolved
Hide resolved
@codelipenghui @coderzc PTAL |
...rc/main/java/org/apache/pulsar/broker/service/persistent/PersistentMessageExpiryMonitor.java
Show resolved
Hide resolved
seems there is a test keeps failing, please check |
…d client clock skew (#21940)
@315157973 could you help to cherry-pick this PR to branch-3.0? I see conflicts. |
…d client clock skew (apache#21940) (cherry picked from commit 861618a)
…d client clock skew (apache#21940) (cherry picked from commit 861618a) (cherry picked from commit fee3a33)
…d client clock skew (apache#21940) (cherry picked from commit 861618a) (cherry picked from commit fee3a33)
…d client clock skew (apache#21940)
…d client clock skew (apache#21940) (cherry picked from commit 861618a)
…time to avoid client clock skew (#21940) (#22211) Co-authored-by: feynmanlin <[email protected]>
Main Issue: #21347
Motivation
When the client machine's clock is incorrect (eg: set to 1 year later) and the Broker does not set the AppendBrokerTimestampMetadataInterceptor, the Ledger will not be cleaned up.
Because if the Broker's timestamp is not set, the expiration check will be based on the client's publish time.
As we discuss in https://lists.apache.org/thread/0vtjt436xvlg0fr4ogchkjdvjcp56mvz
Modifications
TTL not base the on wrong client publish time
Verifying this change
Documentation
doc-not-needed
Matching PR in forked repository
PR in forked repository: 315157973#14