-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wait for DB writes to propagate (causality checks) #392
Wait for DB writes to propagate (causality checks) #392
Conversation
Because we deploy the database in multi-master mode we can have cases where a service writes something in the database and when another one reads from the DB that data is not yet there. This is very problematic, because all the cinder code assumes that that can never happen. For example we've seen in CI jobs the following behavior: - Cinder api creates a worker registry in the DB when deleting a volume on DB node #1. - Cinder api makes an RPC call to cinder-volume to delete the volume. - Cinder volume tries to read the worker registry from DB node #2 but the data is not there yet, so it misbehaves. In this patch we change the default value on the DB engine of not waiting for writes to wait on read, update, and insert. This will have a performance impact, but the alternative is for cinder to misbehave. We use `mysql_wsrep_sync_wait` from oslo.db [1] setting it to 7 as per the documented values of this parameter in the DBMS [2][3]. [1]: https://opendev.org/openstack/oslo.db/commit/009d23df45969036c70e4cf59eb4019aaace9a55 [2]: https://mariadb.com/docs/server/ref/mdb/system-variables/wsrep_sync_wait/ [3]: https://galeracluster.com/library/documentation/mysql-wsrep-options.html
@Akrog: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense, lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
im glad we are seeing multi-master situations already and that we have this flag ready to fix it :) this is all according to plan
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Akrog, zzzeek The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
658ff9a
into
openstack-k8s-operators:main
Fix some inconsistencies in multi-master mode (based on openstack-k8s-operators/cinder-operator#392) Jira: OSPRH-7369
Because we deploy the database in multi-master mode we can have cases where a service writes something in the database and when another one reads from the DB that data is not yet there.
This is very problematic, because all the cinder code assumes that that can never happen.
For example we've seen in CI jobs the following behavior:
Cinder api creates a worker registry in the DB when deleting a volume on DB node 1.
Cinder api makes an RPC call to cinder-volume to delete the volume.
Cinder volume tries to read the worker registry from DB node 2 but the data is not there yet, so it misbehaves.
In this patch we change the default value on the DB engine of not waiting for writes to wait on read, update, and insert.
This will have a performance impact, but the alternative is for cinder to misbehave.
We use
mysql_wsrep_sync_wait
from oslo.db 1 setting it to 7 as per the documented values of this parameter in the DBMS 2 3.