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

fix(carddav): don't read after write for address book creation #42102

Closed
wants to merge 2 commits into from

Conversation

miaulalala
Copy link
Contributor

@miaulalala miaulalala commented Dec 7, 2023

Summary

In clustered setups, a read after write will sporadically fail. We have all the data, so we don't need to query the backend again.

Checklist

Signed-off-by: Anna Larch <anna@nextcloud.com>
@ChristophWurst
Copy link
Member

Does this address #41996?

Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

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

👍 makes a lot of sense

@miaulalala
Copy link
Contributor Author

Does this address #41996?

I'm not sure, but it might help.

Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

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

On a second thought I'm not sure this does help. The INSERT+SELECT is already wrapped in a transaction. A read/write split should still execute both queries on a primary node. Read after write is only problematic outside of transactions.

@ChristophWurst
Copy link
Member

See nextcloud/groupware#24. Mariadb experts have told me to either

  1. Avoid the read
  2. Wrap write+read in a transaction

The address book creation does the latter since #34412.

Did you see this error on a productive instance? Does it run 25?

@miaulalala
Copy link
Contributor Author

right, this is superfluous then

@miaulalala miaulalala closed this Dec 7, 2023
@ChristophWurst ChristophWurst deleted the fix/read-write-for-address-books branch December 7, 2023 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants