WAL GC of anonymous replicas
Nobody has claimed this yet.
- Dominant language
- CSS
- Stars
- 15
- Forks
- 49
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 3
Description
Dev. issue: https://github.com/tarantool/tarantool/issues/10755
Product: Tarantool
Since: 3.3.0
Root document:
- https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_ctl/
- https://www.tarantool.io/en/doc/latest/reference/internals/iproto/replication/
- (?) https://www.tarantool.io/en/doc/latest/platform/storage/persistence/
SME: @ drewdzzz
Details
Connected with #4478, #4479
Now anonymous replicas retain required xlogs just as regular ones.
Since anonymous replicas can suddenly disappear, a new function
box.ctl.replica_gc(uuid) is introduced. It has an only argument,
UUID of replica that must be a string. If the replica is connected right
now or there is no known replica with such UUID, an error is thrown.
The function can be used to cleanup state of a replica that is gone for
a while: it removes WAL GC state of the given replica and deletes it if it
is anonymous. Regular replicas are not evicted from the cluster. By the
way, there is a function box.info.replication_anon() that can be used
to list all anonymous replicas so one can deactivate them with the newly
introduced function - we should mention it somewhere around.
Also, anonymous replicas are deactivated automatically if they haven't
been in touch for too long. Expiration timeout can be controlled by the
new box.cfg.replication_anon_ttl option, the default value is
3600 seconds (1 hour).
IPROTO protocol updates:
- IPROTO_FETCH_SNAPSHOT - is populated with optional
IPROTO_INSTANCE_UUIDkey. If it is passed, sender is considered as
a replica and its WAL GC state is registered. If the key is not
passed, behavior is the same as before. - IPROTO_SUBSCRIBE - now WAL GC state is unconditionally created for a
sender, either anonymous or regular.
Requested by @drewdzzz in https://github.com/tarantool/tarantool/commit/d26f574f8dbad67378cd047f1b9a9a1fec033487.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the box.ctl, replication, and persistence documents linked under Root document. Document box.ctl.replica_gc(uuid), box.info.replication_anon(), replication_anon_ttl, and the IPROTO_FETCH_SNAPSHOT and IPROTO_SUBSCRIBE behavior, including where anonymous replicas are mentioned. Done means the new APIs, timeout, and protocol updates are covered in the relevant documentation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100