Skip to content

ttl setting does not take effect when expiry #12265

@aloyszhang

Description

@aloyszhang

Describe the bug
Expiry based on ttl setting is not working as expected. If a topic has a ledge which has no entry, like

"ledgers" : [ {
    "ledgerId" : 330530,
    "entries" : 8576709,
    "size" : 1020628371,
    "offloaded" : false
  }, {
    "ledgerId" : 330569,
    "entries" : 8285012,
    "size" : 985916428,
    "offloaded" : false
  }, {
    "ledgerId" : 330610,
    "entries" : 5634479,
    "size" : 670503001,
    "offloaded" : false
  }, {
    "ledgerId" : 1702011,
    "entries" : 0,
    "size" : 0,
    "offloaded" : false
  } ]

expiry will move the MarkDeletePosition on entry each time

image

The cause is that when check the expiry, broker will check all message after markdeleteposition, and when getPositionAfterN it may out of range of LAC
To Reproduce
Steps to reproduce the behavior:

  1. Create a topic and a subscription on this topic
  2. Producer some messages and subscribe part of these messages
  3. Unload this topic (make sure this topic has a newest ledger which does not contain any entry)
  4. See the expiry

Expected behavior
TTL should be expected when checking message expiry.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugThe PR fixed a bug or issue reported a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions