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
MB-64910 MB-61292: Change behavior of bucket deks callbacks
Change #1:
set_active_key for buckets should treat enoent and not_supported as
"bucket not found".
When bucket is on disk, but not in memcached (e.g. when cluster
membership is inactiveAdded or inactiveFailed), we can't push
keys to memcached. If we treat it as error (behavior before this this
change), we won't be able to modify encryption-at-rest settings
because cb_cluster_secrets update_bucket_deks status will show error
(issues list will not be empty).
At the same time it seems ok to treat as ok, because memcached
is not encrypting any data in this bucket, so it doesn't need new
keys. When bucket is activated (e.g. we add node back to
the cluster), ns_memcached will push actual keys to memcached in
create_bucket.
Change #2:
Treat not_found in set_active_key as ok, but only when ns_memcached
process doesn't exist before set_active_key attempt.
This is important in order to avoid races when set_active_key and
create_bucket are called in parallel. Basically the following scenario:
1. (process1) ns_memcached fetches old keys
2. (process2) set_active_dek is called (and gets not_found)
3. (process1) ns_memcached creates the bucket with old keys
4. (process1) ns_memcached crashes
5. (process2) we check if ns_memcached is running and return ok
6. Bucket is created with old keys
Change #3:
get_dek_id_in_use should return not_found when bucket doesn't exist
or when memcached returns not_supported.
Reasoning is the same as in change #1.
Basically when there is no bucket in memcached, we should assume
that all current deks are still in use and don't drop anything.
The goal of the change is to not treat it as error basically, because
it leads to the situation when we can't modify encryption-at-rest
settings.
Change-Id: I63cc3e2d7ddbadf5f5866c662858c0dd2d81b270
Reviewed-on: https://review.couchbase.org/c/ns_server/+/223510
Tested-by: Timofey Barmin <[email protected]>
Well-Formed: Build Bot <[email protected]>
Reviewed-by: Navdeep S Boparai <[email protected]>
0 commit comments