You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(redis): the credential-requirements probe lock and the backup lease release with GET-then-DELETE #4252
services/db_backup_service.py:356_release_lease (the backup leader lease)
Each one does lock_token_matches(client.get(key), token) and then client.delete(key). If our lease lapses between the GET and the DELETE, and another worker wins SET NX in that window, the DELETE removes the other worker's lease. Two holders then run at once.
trinity#4028 (PR #4251) removes this shape from SingleFlightLock. With it, its renew and release are one Lua script each, and the scripts live in one place in redis_breaker_util (LEASE_RELEASE_LUA, KEYS[1] = key, ARGV[1] = token). These two releases are outside that issue's scope.
What must be true
Neither release can delete a lease held under another token, including when that token arrives between a client-side read and the delete.
They use the shared lease script, or the reason they can't is written down where the code is.
Tested against an emulator that executes the script text, with a successor winning inside a client-side GET. tests/unit/_ent695_lua.py has one.
Activity