[ 
https://issues.apache.org/jira/browse/BOOKKEEPER-154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13188902#comment-13188902
 ] 

Sijie Guo commented on BOOKKEEPER-154:
--------------------------------------

currently we don't have publish timestamp for each message. it would be not 
easy to implement such time-based garbage collection policy in hub server 
itself. 

so a proposal is to provide a offline tool to check subscriber's state to do 
time based gc. if a subscriber is inactive for a long time, the offline tool 
send a CONSUME request for this subscriber to consume to the lastest message.

the tool works as below:

loop over all topics, for each topic:
1) find the subscriber who is inactive for a long time: read subscriber znodes, 
we can get the modify time for these znodes. if these znodes are not modified 
for a long time, it means that these subscribers were not active for a long 
time.
2) read the lastest message id : we can parse ledgers znode to get it. we did 
the similar thing in BOOKKEEPER-77 .
3) do #subscribe the topic for the found inactive subscribers. (if these 
subscribers are online, the subscription would be fail. we should not do 
CONSUME for them) send a CONSUME request to hub server for them, to consume to 
the lastest message.


                
> Garbage collect messages for those subscribers inactive/offline for a long 
> time. 
> ---------------------------------------------------------------------------------
>
>                 Key: BOOKKEEPER-154
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-154
>             Project: Bookkeeper
>          Issue Type: New Feature
>          Components: hedwig-client, hedwig-server
>    Affects Versions: 4.0.0
>            Reporter: Sijie Guo
>
> Currently hedwig tracks subscribers progress for garbage collecting published 
> messages. If subscriber subscribe and becomes offline without unsubscribing 
> for a long time, those messages published in its topic have no chance to be 
> garbage collected.
> A time based garbage collection policy would be suitable for this case. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to