Files
seaweedfs/weed/worker
8760e2778b worker: dir_usage takes off what a TTL expires (#13369)
* worker: dir_usage takes off what a TTL expires

A plain TTL removes an expired row without an event, so a record kept
counting it until its bucket was seeded again. An entry's attributes say
when listings start leaving it out (Entry.ExpiresAt, which listingExpired
now uses), so a record keeps what each directory has still to expire,
grouped by the step it expires in, and each run takes off what came off
by its position. A step is an hour, or for a TTL of 200 hours or more the
largest power of two hours up to 1% of it, so a record stays bounded.

An event counts an entry only if the record has not taken it off yet, so
an S3 expiry, which logs a delete, comes off once. Record version 2 seeds
the records made before again.

Part of #13257.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* dir_usage: decide a seeded directory's share after what expired

The seed took off what had expired by its position only after the final
share check, so a directory the walk kept could be dropped against a
total that still counted those entries. Take them off first, and hand
what a dropped directory has still to expire to the directory above.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* dir_usage: drop a seeded directory below its share with dropTracked

A directory below its share has none above its share below it, so
dropping it with what is below, its entries staying counted above, is
what untrack did.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com>
2026-12-03 23:40:58 -08:00
..