mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-28 04:06:59 +00:00
In this patch we add an incomplete implementation of an expiration service to Alternator, which periodically scans the data in the table, looking for expired items and deleting them. This implementation involves a new "expiration service" which runs a background scan in each shard. Each shard "owns" a subset of the token ranges - the intersection of the node's primary ranges with this shard's token ranges - and scans those ranges over and over, deleting any items which are found expired. This implementation is good enough to make all existing tests but one pass, but is still a partial and inefficient implementation littered with FIXMEs throughout the code. Among other things, this implementation doesn't do anything reasonable about pacing of the scan or about multiple tables, it scans entire items instead of only the needed parts, and if a node goes down, the part of the token range which it "owns" will not be scanned for expiration (we need living nodes to take over the background expiration work for dead nodes). The current tests cannot expose these problems, so we will need to develop additional tests for them. Because this implementation is very partial, the Alternator TTL continues to remain "experimental", cannot be used without explicitly enabling this experimental feature, and must not be used for any important deployment. The new TTL expiration service will only run (at the moment) in the background if the Alternator TTL experimental feature is enabled and and if Alternator is enabled as well. Signed-off-by: Nadav Har'El <nyh@scylladb.com>
206 KiB
206 KiB