Skip to content

[Issue 6283][Offloaders] Offload policies per ns with deletionLag & threshold - #6381

Closed
KannarFr wants to merge 10 commits into
apache:masterfrom
CleverCloud:offload-policies-per-ns
Closed

[Issue 6283][Offloaders] Offload policies per ns with deletionLag & threshold#6381
KannarFr wants to merge 10 commits into
apache:masterfrom
CleverCloud:offload-policies-per-ns

Conversation

@KannarFr

Copy link
Copy Markdown
Contributor

Fixes #6283

Modifications

Define and use custom deletionLag and threshold for offloadpolicies per ns

Verifying this change

  • Make sure that the change passes the CI checks.

This change is already covered by existing tests, such as .

Does this pull request potentially affect one of the following parts:

  • The public API: yes, new fields to add to offloadpolicies
  • The admin cli options: yes, new fields to add to offloadpolicies

Documentation

  • Does this pull request introduce a new feature? yes
  • If yes, how is the feature documented? not documented

@KannarFr
KannarFr force-pushed the offload-policies-per-ns branch 2 times, most recently from fd25451 to 7299bc2 Compare February 20, 2020 13:15
@KannarFr

Copy link
Copy Markdown
Contributor Author

@gaoran10 Hi, can you review this?

@KannarFr
KannarFr force-pushed the offload-policies-per-ns branch 6 times, most recently from 08a513a to f020923 Compare February 21, 2020 14:16
@sijie sijie added this to the 2.6.0 milestone Feb 22, 2020
@codelipenghui

Copy link
Copy Markdown
Contributor

@gaoran10 Please also help review this PR since you have done lots of work in the namespace level offload policy.

@codelipenghui codelipenghui left a comment

Copy link
Copy Markdown
Contributor

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.

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;

Copy link
Copy Markdown
Contributor

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).

Copy link
Copy Markdown
Contributor Author

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?

Comment on lines +1468 to +1485
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);
}
}

Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown
Contributor Author

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?

@gaoran10

gaoran10 commented Feb 22, 2020

Copy link
Copy Markdown
Contributor

Looks good to me!

Could you fix the description of the command set-offload-policies and get-offload-policies in the doc reference-pulsar-admin.md.

@KannarFr
KannarFr force-pushed the offload-policies-per-ns branch from f020923 to 6e0422c Compare February 24, 2020 10:53
@KannarFr
KannarFr force-pushed the offload-policies-per-ns branch 2 times, most recently from bed776e to 7c07d43 Compare February 24, 2020 11:27
@KannarFr
KannarFr force-pushed the offload-policies-per-ns branch from 7c07d43 to 5447572 Compare February 24, 2020 12:08
@KannarFr KannarFr changed the title [Issue 6283][Offloaders] WIP - Offload policies per ns with deletionLag & threshold [Issue 6283][Offloaders] Offload policies per ns with deletionLag & threshold Feb 24, 2020
@KannarFr

Copy link
Copy Markdown
Contributor Author

I am not sure the failing tests are linked to this PR? Isn't it?

@sijie

sijie commented Feb 24, 2020

Copy link
Copy Markdown
Member

/pulsarbot run-failure-checks

@KannarFr
KannarFr force-pushed the offload-policies-per-ns branch 2 times, most recently from e6ebb2e to ad5f812 Compare February 24, 2020 22:44
@KannarFr
KannarFr force-pushed the offload-policies-per-ns branch from 3a93d9c to c678557 Compare February 25, 2020 14:58
@KannarFr
KannarFr force-pushed the offload-policies-per-ns branch from c678557 to 0114cfa Compare February 25, 2020 16:43
@KannarFr

Copy link
Copy Markdown
Contributor Author

After discuss with @sijie, I prefer to create a fresh PR on #6422.

@KannarFr KannarFr closed this Feb 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[offloaders] Define treshold and deletionMaxLag per ns or use the default one.

4 participants