-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Namespace level offloader #6183
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
Namespace level offloader #6183
Conversation
…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
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.
The main concern is the offloader cache, because is users frequently modified the policy, there will be some invalid Offloader objects here.
pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/OffloadPolicies.java
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java
Outdated
Show resolved
Hide resolved
| } | ||
| } else { | ||
| LOG.info("No ledger offloader configured, using NULL instance"); | ||
| LOG.warn("No ledger offloader configured, using NULL instance"); |
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.
Keep log level to info, we don't need to warn users when they have not enable the offloader.
pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/Namespaces.java
Outdated
Show resolved
Hide resolved
pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/Namespaces.java
Outdated
Show resolved
Hide resolved
| import org.apache.pulsar.common.policies.data.OffloadPolicies; | ||
| import org.apache.pulsar.common.policies.data.OffloadPolicies; |
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 duplicated
pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdNamespaces.java
Outdated
Show resolved
Hide resolved
| } | ||
|
|
||
| private LedgerOffloader initManagedLedgerOffloader(PulsarConnectorConfig conf) { | ||
| private LedgerOffloader initManagedLedgerOffloader(PulsarConnectorConfig conf, OffloadPolicies offloadPolicies) { |
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.
Same as PulsarService, use initManagedLedgerOffloader(OffloadPolicies offloadPolicies). For default offloader, just convert serverConfiguration to the OffloadPolicies.
pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java
Outdated
Show resolved
Hide resolved
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.
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.
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.
2. modify the `get-offload` to `get-offload-policies`; 3. add the OffloadPolicies validate in NamespacesBase.
sijie
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.
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.
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java
Outdated
Show resolved
Hide resolved
|
@gaoran10 well done! |
|
@gaoran10 Please take a look sijie's comments. nice job 👍 |
@codelipenghui ok, I will fix them. |
|
@sijie Thank you! |
2. modify setOffloadPolicies api error message.
…10/pulsar into namespace-level-offloader
|
@gaoran10 Hi, thanks for the work you did there. We are missing a point that I didn't precise in original issue: |
@KannarFr Hi, thanks for your suggestions. In currently, maybe the config |
|
Yup, closed on #6283 but forget here, sorry. |
|
Add label to 2.5.1, due to #6325 dependency |
### 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)
### 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)
### 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)
### 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.
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.
Documentation