-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Issue 6283][Offloaders] Offload policies per ns with deletionLag & threshold #6381
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
Conversation
fd25451 to
7299bc2
Compare
|
@gaoran10 Hi, can you review this? |
08a513a to
f020923
Compare
|
@gaoran10 Please also help review this PR since you have done lots of work in the namespace level offload policy. |
codelipenghui
left a comment
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.
Looks good to me, just left some minor comments, please take a look.
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/ManagedLedgerConfig.java
Outdated
Show resolved
Hide resolved
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/ManagedLedgerConfig.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java
Show resolved
Hide resolved
| public final static String[] DRIVER_NAMES = {"S3", "aws-s3", "google-cloud-storage", "filesystem"}; | ||
| public final static String DEFAULT_OFFLOADER_DIRECTORY = "./offloaders"; | ||
| public final static long DEFAULT_OFFLOAD_OFFLOAD_THRESHOLD = -1; | ||
| public final static Long DEFAULT_OFFLOAD_OFFLOAD_DELETION_LAG_MS = null; |
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.
Maybe the default value of this config could keep the original value (4 hours).
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.
As it's deletion configuration I prefer set the default value to no deletion. WDYT?
| Long offloadAfterElapsedInMillis = OffloadPolicies.DEFAULT_OFFLOAD_OFFLOAD_DELETION_LAG_MS; | ||
| if (StringUtils.isNotEmpty(offloadAfterElapsedStr) ) { | ||
| Long offloadAfterElapsed = TimeUnit.SECONDS.toMillis(RelativeTimeUtil.parseRelativeTimeInSeconds(offloadAfterElapsedStr)); | ||
| if (positiveCheck("OffloadAfterElapsed", offloadAfterElapsed) | ||
| && maxValueCheck("OffloadAfterElapsed", offloadAfterElapsed, Long.MAX_VALUE)) { | ||
| offloadAfterElapsedInMillis = new Long(offloadAfterElapsed); | ||
| } | ||
| } | ||
|
|
||
| long offloadAfterThresholdInBytes = OffloadPolicies.DEFAULT_READ_BUFFER_SIZE_IN_BYTES; | ||
| if (StringUtils.isNotEmpty(offloadAfterThresholdStr) ) { | ||
| long offloadAfterThreshold = validateSizeString(offloadAfterThresholdStr); | ||
| if (positiveCheck("OffloadAfterThreshold", offloadAfterThreshold) | ||
| && maxValueCheck("OffloadAfterThreshold", offloadAfterThreshold, Long.MAX_VALUE)) { | ||
| offloadAfterThresholdInBytes = new Long(offloadAfterThreshold); | ||
| } | ||
| } | ||
|
|
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 have a question, there are tow CLI-commands can change the managedLedgerOffloadTreshold config and the managedLedgerOffloadDeletionLagMs config, if we use the command set-offload-threshold or set-offload-deletion-lag to set the config first, then we use the command set-offload-policies to set the bucket except for managedLedgerOffloadTreshold and managedLedgerOffloadDeletionLagMs, they will be overridden to default.
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.
"they will be overridden to default.", can you link where override is done?
|
Looks good to me! Could you fix the description of the command |
f020923 to
6e0422c
Compare
bed776e to
7c07d43
Compare
7c07d43 to
5447572
Compare
|
I am not sure the failing tests are linked to this PR? Isn't it? |
|
/pulsarbot run-failure-checks |
e6ebb2e to
ad5f812
Compare
3a93d9c to
c678557
Compare
c678557 to
0114cfa
Compare
Fixes #6283
Modifications
Define and use custom deletionLag and threshold for offloadpolicies per ns
Verifying this change
This change is already covered by existing tests, such as .
Does this pull request potentially affect one of the following parts:
Documentation