Skip to content

expiry: sweep ticks still enter the cycle when nothing is due — one index head-peek can skip them #552

Description

@TinDang97

The maybe_has_expiring_keys latch only saves databases with ZERO TTL'd keys; a TTL-heavy database enters expire_cycle every 100ms just to peek the index and find nothing due. Since #549 the earliest deadline is O(log n) at the index head: expire_cycle_direct can return immediately when next_deadline > now and no lazy-expired queue is pending and the hash latch is down — making the sweep free for every database whose keys aren't due yet (compounds the #373 idle-CPU work).

Follow-on (separate decision): arm the shard timer at the head deadline instead of the fixed 100ms cadence, sharpening expiry precision and expired-notification timeliness from ≤100ms lag to near-exact.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions