You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/08/19 12:55:15 UTC

[GitHub] [pulsar] fsergii opened a new issue #11719: Namespace retention policy not working as expected

fsergii opened a new issue #11719:
URL: https://github.com/apache/pulsar/issues/11719


   **Describe the bug**
   I`m trying to set a retention policy for namespace 
   bin/pulsar-admin namespaces set-retention testtenant/testnamespace --size -1 --time 1m
   
   The main purpose is to save messages on topics even if there is no subscription. But not to store them infinitely, and delete them when some time passed.
   When you set retention policy messages start writing to the topic without subscriptions but it seems for infinite time.
   I can receive messages even after 1 hour after message is published by the producer (when policy time is set for 1 minute).
   
   **To Reproduce**
   Steps to reproduce the behavior:
   1. Create tenant (testtenant for example)
   2. Create namespace (testnamespace for example)
   3. Set retention for namespace bin/pulsar-admin namespaces set-retention testtenant/testnamespace --size -1 --time 1m
   4. Publish a message with python 
   `import pulsar`
   `client = pulsar.Client('pulsar://pulsar:6650')`
   `producer = client.create_producer('persistent://testtenant/testnamespace/test')`
   `producer.send(('Hello-pulsar').encode('utf-8'))`
   `client.close()`
   5. Wait time more than 1 minute and try to receive message with python 
   `import pulsar`
   `client = pulsar.Client('pulsar://pulsar:6650')`
   `consumer = client.subscribe('persistent://testtenant/testnamespace/test', 'my-subscription')`
   `msg = consumer.receive()`
   `print("Received message '{}' id='{}'".format(msg.data(), msg.message_id()))`
   `consumer.acknowledge(msg)`
   `client.close()`
   
   **Expected behavior**
   Message in topic with message age more than in --time parameter deletes
   
   **Screenshots**
   n/a
   
   **Desktop (please complete the following information):**
    - Ubuntu 20.04
    - Pulsar deployed in Kubernetes with official pulsar helm
    - Pulsar 2.7.2
   
   **Additional context**
   n/a
   


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] fsergii commented on issue #11719: Namespace retention policy not working as expected

Posted by GitBox <gi...@apache.org>.
fsergii commented on issue #11719:
URL: https://github.com/apache/pulsar/issues/11719#issuecomment-902847392


   Thanks for your reply. So it seems not a bug then, but normal behavior. So I think I can close the issue.


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] fsergii commented on issue #11719: Namespace retention policy not working as expected

Posted by GitBox <gi...@apache.org>.
fsergii commented on issue #11719:
URL: https://github.com/apache/pulsar/issues/11719#issuecomment-902454976


   @Technoboy- so there is no guarantee that message will be deleted after a period in "time" parameter and we nothing can`t do to fix this behavior? 


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] fsergii closed issue #11719: Namespace retention policy not working as expected

Posted by GitBox <gi...@apache.org>.
fsergii closed issue #11719:
URL: https://github.com/apache/pulsar/issues/11719


   


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] gaozhangmin commented on issue #11719: Namespace retention policy not working as expected

Posted by GitBox <gi...@apache.org>.
gaozhangmin commented on issue #11719:
URL: https://github.com/apache/pulsar/issues/11719#issuecomment-902461203


   > @Technoboy- so there is no guarantee that message will be deleted after a period in "time" parameter and we nothing can`t do to fix this behavior?
   
   For opened ledger, broker will roll over it every 4 hours by default. So, opened ledger will be deleted after  4 hours.


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] gaozhangmin commented on issue #11719: Namespace retention policy not working as expected

Posted by GitBox <gi...@apache.org>.
gaozhangmin commented on issue #11719:
URL: https://github.com/apache/pulsar/issues/11719#issuecomment-902010687


   It seem that pulsar retention onyl takes effect in closed ledger.


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] Technoboy- commented on issue #11719: Namespace retention policy not working as expected

Posted by GitBox <gi...@apache.org>.
Technoboy- commented on issue #11719:
URL: https://github.com/apache/pulsar/issues/11719#issuecomment-902360912


   > It seem that pulsar retention onyl takes effect in closed ledger.
   
   @gaozhangmin @fsergii 
   Yes, the remove operation is based on segment in bk, and only remove these when they are closed. Different messages may store in different segments. 
   Even though you set the retention policy to 1m, but maybe the segment is open.


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org