mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-12-03 07:55:25 +00:00
* feat(mito2): take a region over from a source that reported no entry On a region whose manifest is published conditionally, a catchup that makes the region writable and names its source but no reported entry (a takeover) hands the region over without replaying, as a handover does. The engine prepares the takeovers of a batch: it reads the latest manifest version of each, asks for one heartbeat, and lists the WAL of each source once for a bound. The log store hands the region over while the catchup waits for a lease of the migration's candidate from a heartbeat sent after the version read. Under the manifest lock the lease and the version are checked again, and the commit records this node's handoff floor and, if the bound is above where the manifest recovers the source's WAL from, a listed tail up to the bound. The region worker applies the edit and promotes the region. A region that skips the WAL commits an empty edit after the same wait. A takeover of a region that awaits its Leader lease is caught up again as on main, and commits only after the prepared version while the latest lease is the candidate's. RegionCatchupRequest gains candidate_lease_id, passed from the upgrade instruction to the data region. The datanode sends a requested heartbeat a millisecond after the request; one already due sooner is kept and another follows it, and the scheduled time is kept during its reconnect backoff. Signed-off-by: jeremyhi <fengjiachun@gmail.com> * fix(mito2): keep the status of a failed source WAL listing A takeover whose listing of the source's WAL fails now reports that listing's status and retry hint: the error is shared across the takeovers of a batch as an Arc<BoxedError> instead of a message and a status, so a transient failure stays retryable and an empty WAL is not. Document what the candidate-lease wait returns, how the worker answers a takeover it was or was not prepared for, and what an abandoned hand-off leaves. Cover a manifest that moves during the candidate-lease wait and a takeover whose reopen fails. Signed-off-by: jeremyhi <fengjiachun@gmail.com> * docs(mito2): clarify takeover preparation error doc Signed-off-by: jeremyhi <fengjiachun@gmail.com> --------- Signed-off-by: jeremyhi <fengjiachun@gmail.com>