Skip to content
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

Merged

Conversation

Akrog
Copy link
Contributor

@Akrog Akrog commented May 29, 2024

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.

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
@openshift-ci openshift-ci bot requested review from abays and stuggi May 29, 2024 10:14
Copy link
Contributor

openshift-ci bot commented May 29, 2024

@Akrog: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/cinder-operator-build-deploy-tempest 67b2877 link false /test cinder-operator-build-deploy-tempest

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.

Copy link

@bogdando bogdando left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense, lgtm

Copy link
Contributor

@zzzeek zzzeek left a 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

Copy link
Contributor

openshift-ci bot commented May 29, 2024

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit 658ff9a into openstack-k8s-operators:main May 29, 2024
6 of 7 checks passed
gthiemonge added a commit to gthiemonge/octavia-operator that referenced this pull request May 29, 2024
Fix some inconsistencies in multi-master mode (based on
openstack-k8s-operators/cinder-operator#392)

Jira: OSPRH-7369
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants