[Issue 6283][Offloaders] Offload policies per ns with deletionLag & threshold - #6381
[Issue 6283][Offloaders] Offload policies per ns with deletionLag & threshold#6381KannarFr wants to merge 10 commits into
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.
Looks good to me, just left some minor comments, please take a look.
| 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.
Maybe the default value of this config could keep the original value (4 hours).
There was a problem hiding this comment.
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.
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.
"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