We send COW pointers to sys catalog write (Mutate) and expect the caller to hold the write lock. This is not enforced at build time there are cases where we will miss it and not catch it in any tests.
A cleaner option is to pass the WriteLock to Mutate, and also make sure the lock holds a ref to the COW object itself.
This will require a big refactor of master code.
Deletes do not require a lock today, which can also cause unexpected behavior. Once deleted the COW should prevent a write lock, but this mechanism does not exist today. See how to improve this as well.
Issue Type
kind/enhancement
Warning: Please confirm that this issue does not contain any sensitive information
[X] I confirm this issue does not contain any sensitive information.
Jira Link: DB-14128
Description
Related to https://github.com/yugabyte/yugabyte-db/issues/24929
We send COW pointers to sys catalog write (
Mutate
) and expect the caller to hold the write lock. This is not enforced at build time there are cases where we will miss it and not catch it in any tests. A cleaner option is to pass the WriteLock to Mutate, and also make sure the lock holds a ref to the COW object itself. This will require a big refactor of master code.Deletes do not require a lock today, which can also cause unexpected behavior. Once deleted the COW should prevent a write lock, but this mechanism does not exist today. See how to improve this as well.
Issue Type
kind/enhancement
Warning: Please confirm that this issue does not contain any sensitive information