codelipenghui commented on code in PR #16357:
URL: https://github.com/apache/pulsar/pull/16357#discussion_r940206001


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:
##########
@@ -850,6 +851,29 @@ protected CompletableFuture<OffloadPoliciesImpl> 
internalGetOffloadPolicies(bool
         return getTopicPoliciesAsyncWithRetry(topicName, isGlobal)
             .thenCompose(op -> {
                 TopicPolicies topicPolicies = op.orElseGet(TopicPolicies::new);
+                OffloadPoliciesImpl currentOffloadPolicies = 
topicPolicies.getOffloadPolicies();
+                if (currentOffloadPolicies != null && offloadPolicies != null){
+                    if 
(Objects.equals(offloadPolicies.getManagedLedgerOffloadDeletionLagInMillis(),
+                            
OffloadPoliciesImpl.DEFAULT_OFFLOAD_DELETION_LAG_IN_MILLIS)) {
+                        
offloadPolicies.setManagedLedgerOffloadDeletionLagInMillis(
+                                
currentOffloadPolicies.getManagedLedgerOffloadDeletionLagInMillis());

Review Comment:
   I think this will change the behavior. After this change, users are not able 
to set the lagInMillis to null?



##########
site2/docs/reference-pulsar-admin.md:
##########
@@ -2470,6 +2470,35 @@ Options
 |`-w`, `--wait-complete`|Wait for compaction to complete|false|
 
 
+### `set-offload-policies`
+Set the offload policy for a topic.
+
+Usage
+
+```bash
+
+$ pulsar-admin topic set-offload-policies tenant/namespace/topic options

Review Comment:
   ```suggestion
   $ pulsar-admin topics set-offload-policies tenant/namespace/topic options
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to