Skip to content

Conversation

@gaoran10
Copy link
Contributor

@gaoran10 gaoran10 commented Jan 31, 2020

This work was originally developed by @KannarFr at pull request #4739. This pull request was based on #4739

Fixes: #4547

Motivation

Currently, the offload operation only have the cluster level configuration, can't set the offload configuration at the namespace level, it's inflexible.

Modifications

Add the namespace offload policies.

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API: (yes)
  • The schema: (no)
  • The default values of configurations: (no)
  • The wire protocol: (no)
  • The rest endpoints: (yes)
  • The admin cli options: (yes)
  • Anything that affects deployment: (don't know)

Documentation

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

gao.ran added 5 commits February 1, 2020 04:12
…namespace-level-offloader

# Conflicts:
#	pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/Namespaces.java
#	pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdNamespaces.java
Copy link
Contributor

@codelipenghui codelipenghui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main concern is the offloader cache, because is users frequently modified the policy, there will be some invalid Offloader objects here.

}
} else {
LOG.info("No ledger offloader configured, using NULL instance");
LOG.warn("No ledger offloader configured, using NULL instance");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep log level to info, we don't need to warn users when they have not enable the offloader.

Comment on lines 46 to 47
import org.apache.pulsar.common.policies.data.OffloadPolicies;
import org.apache.pulsar.common.policies.data.OffloadPolicies;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks duplicated

}

private LedgerOffloader initManagedLedgerOffloader(PulsarConnectorConfig conf) {
private LedgerOffloader initManagedLedgerOffloader(PulsarConnectorConfig conf, OffloadPolicies offloadPolicies) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as PulsarService, use initManagedLedgerOffloader(OffloadPolicies offloadPolicies). For default offloader, just convert serverConfiguration to the OffloadPolicies.

@codelipenghui codelipenghui added this to the 2.6.0 milestone Feb 1, 2020
gao.ran added 2 commits February 5, 2020 14:05
2. Add methods for interface LedgerOffloader, add the getOffloadPolicies method, add close method;
2. Unified the offload policies configuration type, use the OffloadPolicies instead of TieredStorageConfigurationData and FileSystemConfigurationData.
Copy link
Contributor

@codelipenghui codelipenghui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good, please help try to add some integration test to cover the changes.
I'm concern about current implementation related to namespace policy changes in Pulsar SQL.
In this PR, split manager fetches namespace policies. This will lead to more admin API requests.

@sijie @jiazhai Is there any better approach? or we need to add a flag to disable fetch namespace policy.
Pulsar SQL may have many workers, regularly fetch still not a good way.

gao.ran added 2 commits February 5, 2020 22:29
2. modify the `get-offload` to `get-offload-policies`;
3. add the OffloadPolicies validate in NamespacesBase.
Copy link
Member

@sijie sijie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall looks good.

@codelipenghui I think split manager is only run when a job is submitted. once the split is created, I don't think each split is fetching the namespace policies. so that should be fine.

@sijie
Copy link
Member

sijie commented Feb 7, 2020

@gaoran10 well done!

@codelipenghui
Copy link
Contributor

@gaoran10 Please take a look sijie's comments. nice job 👍

@gaoran10 gaoran10 closed this Feb 7, 2020
@gaoran10 gaoran10 reopened this Feb 7, 2020
@gaoran10
Copy link
Contributor Author

gaoran10 commented Feb 7, 2020

@gaoran10 Please take a look sijie's comments. nice job 👍

@codelipenghui ok, I will fix them.

@gaoran10
Copy link
Contributor Author

gaoran10 commented Feb 7, 2020

@sijie Thank you!

@sijie
Copy link
Member

sijie commented Feb 10, 2020

Thanks @KannarFr for the initial change and thanks @gaoran10 for continuing @KannarFr 's awesome work. It is a great example of teamwork and community collaboration! Thanks everyone involved in this pull request.

@codelipenghui codelipenghui merged commit fd03be5 into apache:master Feb 10, 2020
@KannarFr
Copy link
Contributor

@gaoran10 Hi, thanks for the work you did there.

We are missing a point that I didn't precise in original issue: internalSetOffloadDeletionLag and internalSetOffloadThreshold should have their own values per ns or use default configuration. I created a new issue #6283. (i.e. currently we will have the same trigger policies for every ns, but we want to define per ns).

@gaoran10
Copy link
Contributor Author

We are missing a point that I didn't precise in original issue: internalSetOffloadDeletionLag and internalSetOffloadThreshold should have their own values per ns or use default configuration. I created a new issue #6283. (i.e. currently we will have the same trigger policies for every ns, but we want to define per ns).

@KannarFr Hi, thanks for your suggestions. In currently, maybe the config internalSetOffloadDeletionLag and internalSetOffloadThreshold belong to namespace is supported, refer to these API 'http://pulsar.apache.org/admin-rest-api/?version=2.5.0#operation/setOffloadDeletionLag' and 'http://pulsar.apache.org/admin-rest-api/?version=2.5.0#operation/setOffloadThreshold'.

@KannarFr
Copy link
Contributor

Yup, closed on #6283 but forget here, sorry.

@tuteng
Copy link
Member

tuteng commented Mar 21, 2020

Add label to 2.5.1, due to #6325 dependency

tuteng pushed a commit to AmateurEvents/pulsar that referenced this pull request Mar 21, 2020
### Motivation

Currently, the offload operation only have the cluster level configuration, can't set the offload configuration at the namespace level, it's inflexible. 

### Modifications

Add the namespace offload policies.

(cherry picked from commit fd03be5)
tuteng pushed a commit that referenced this pull request Apr 13, 2020
### Motivation

Currently, the offload operation only have the cluster level configuration, can't set the offload configuration at the namespace level, it's inflexible. 

### Modifications

Add the namespace offload policies.

(cherry picked from commit fd03be5)
jiazhai pushed a commit to jiazhai/pulsar that referenced this pull request May 18, 2020
### Motivation

Currently, the offload operation only have the cluster level configuration, can't set the offload configuration at the namespace level, it's inflexible.

### Modifications

Add the namespace offload policies.
(cherry picked from commit fd03be5)
huangdx0726 pushed a commit to huangdx0726/pulsar that referenced this pull request Aug 24, 2020
### Motivation

Currently, the offload operation only have the cluster level configuration, can't set the offload configuration at the namespace level, it's inflexible. 

### Modifications

Add the namespace offload policies.
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.

set offload bucket per topic and per tenant/namespace

5 participants