Skip to content

Release expired verification leases periodically

Sami Hiltunen requested to merge smh-release-stale-leases into master

The background verifier sets a lease time on a replica when it picks it up for verification. If the worker dies for some reason, the lease will remain in place and no other worker will pick up the replica for verificaiton again until the lease is cleared. The lease itself tells the maximum time the worker itself would be working on the replica. After it has been passed, it would be safe for another worker to pick up the replica for verification again. This commit adds a background goroutine that periodically releases expired leases so other workers can take up the work if the original worker failed and did not release the lease. The 'verificaton_leases' index is added so the query can efficiently find the replicas with leases acquired to find the stale ones.

Part of: #4080 (closed)

Edited by Sami Hiltunen

Merge request reports