local function unlock_all_associated_keys (key, lock_id) if not owns_lock(key, lock_id) then return { "lock_not_owned" } end local existing_entry = get_existing_entry(key) if not existing_entry then return release_lock(key, lock_id) end local existing_additional_keys = existing_entry.additional_lock_keys if not owns_locks(existing_additional_keys, lock_id) then return { "lock_not_owned" } end release_lock(key, lock_id) release_locks(existing_additional_keys, lock_id) return { "ok" } end return scriptResult(unlock_all_associated_keys(KEYS[1], ARGV[3]))