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

mixing transaction isolation levels #18929

Merged
merged 4 commits into from
Sep 27, 2024
Merged

mixing transaction isolation levels #18929

merged 4 commits into from
Sep 27, 2024

Conversation

taroface
Copy link
Contributor

@taroface taroface commented Sep 20, 2024

DOC-10911

Document txn behavior when mixing Serializable and Read Committed txns.

Preview: https://deploy-preview-18929--cockroachdb-docs.netlify.app/docs/v24.2/transactions.html#mixed-isolation-levels

Copy link

Files changed:

Copy link

netlify bot commented Sep 20, 2024

Deploy Preview for cockroachdb-api-docs canceled.

Name Link
🔨 Latest commit 2ce914d
🔍 Latest deploy log https://app.netlify.com/sites/cockroachdb-api-docs/deploys/66f70283badde5000853665c

Copy link

netlify bot commented Sep 20, 2024

Deploy Preview for cockroachdb-interactivetutorials-docs canceled.

Name Link
🔨 Latest commit 2ce914d
🔍 Latest deploy log https://app.netlify.com/sites/cockroachdb-interactivetutorials-docs/deploys/66f70283a4ed0c000849a999

Copy link

netlify bot commented Sep 20, 2024

Netlify Preview

Name Link
🔨 Latest commit 2ce914d
🔍 Latest deploy log https://app.netlify.com/sites/cockroachdb-docs/deploys/66f70283ccaf7d00081327d0
😎 Deploy Preview https://deploy-preview-18929--cockroachdb-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

@michae2 michae2 left a comment

Choose a reason for hiding this comment

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

Looks great! Just one suggestion which you can take or leave.

src/current/_includes/v23.2/sql/mixed-isolation-levels.md Outdated Show resolved Hide resolved
Copy link
Member

@nvanbenschoten nvanbenschoten left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@florence-crl florence-crl left a comment

Choose a reason for hiding this comment

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

lgtm non-blocking formatting nit for all versions to add break tags for readability

Screenshot 2024-09-27 at 10 55 04 AM

Comment on lines +5 to +6
- If a `READ COMMITTED` transaction `R` commits before a `SERIALIZABLE` transaction `S`, every statement in `S` will observe all writes from `R`. Otherwise, `S` will not observe any writes from `R`.
- If a `SERIALIZABLE` transaction `S` commits before a `READ COMMITTED` transaction `R`, every **subsequent** statement in `R` will observe all writes from `S`. Otherwise, `R` will not observe any writes from `S`.
Copy link
Contributor

Choose a reason for hiding this comment

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

formatting nit, add break tags

Suggested change
- If a `READ COMMITTED` transaction `R` commits before a `SERIALIZABLE` transaction `S`, every statement in `S` will observe all writes from `R`. Otherwise, `S` will not observe any writes from `R`.
- If a `SERIALIZABLE` transaction `S` commits before a `READ COMMITTED` transaction `R`, every **subsequent** statement in `R` will observe all writes from `S`. Otherwise, `R` will not observe any writes from `S`.
- If a `READ COMMITTED` transaction `R` commits before a `SERIALIZABLE` transaction `S`,<br>every statement in `S` will observe all writes from `R`.<br>Otherwise, `S` will not observe any writes from `R`.
- If a `SERIALIZABLE` transaction `S` commits before a `READ COMMITTED` transaction `R`,<br>every **subsequent** statement in `R` will observe all writes from `S`.<br> Otherwise, `R` will not observe any writes from `S`.

so it is a bit more readable

Screenshot 2024-09-27 at 10 59 02 AM

Comment on lines +10 to +12
- If a `READ COMMITTED` transaction `R` writes but does not commit before a `SERIALIZABLE` transaction `S`, no statement in `S` will observe or be blocked by any uncommitted writes from `R`.
- If a `SERIALIZABLE` transaction `S` writes but does not commit before a `READ COMMITTED` transaction `R`, no statement in `R` will observe or be blocked by any uncommitted writes from `S`.
- If a `SERIALIZABLE` transaction `S1` writes but does not commit before a `SERIALIZABLE` transaction `S2`, the first statement in `S2` that would observe an unwritten row from `S1` will be blocked until `S1` commits or aborts.
Copy link
Contributor

Choose a reason for hiding this comment

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

add break tags for readability

Suggested change
- If a `READ COMMITTED` transaction `R` writes but does not commit before a `SERIALIZABLE` transaction `S`, no statement in `S` will observe or be blocked by any uncommitted writes from `R`.
- If a `SERIALIZABLE` transaction `S` writes but does not commit before a `READ COMMITTED` transaction `R`, no statement in `R` will observe or be blocked by any uncommitted writes from `S`.
- If a `SERIALIZABLE` transaction `S1` writes but does not commit before a `SERIALIZABLE` transaction `S2`, the first statement in `S2` that would observe an unwritten row from `S1` will be blocked until `S1` commits or aborts.
- If a `READ COMMITTED` transaction `R` writes but does not commit before a `SERIALIZABLE` transaction `S`,<br>no statement in `S` will observe or be blocked by any uncommitted writes from `R`.
- If a `SERIALIZABLE` transaction `S` writes but does not commit before a `READ COMMITTED` transaction `R`,<br>no statement in `R` will observe or be blocked by any uncommitted writes from `S`.
- If a `SERIALIZABLE` transaction `S1` writes but does not commit before a `SERIALIZABLE` transaction `S2`,<br>the first statement in `S2` that would observe an unwritten row from `S1` will be blocked until `S1` commits or aborts.
Screenshot 2024-09-27 at 10 59 13 AM

@taroface
Copy link
Contributor Author

taroface commented Sep 27, 2024

lgtm non-blocking formatting nit for all versions to add break tags for readability

TFTR! I am going to merge as-is because I think this is a larger style issue. I think inserting break tags in the middle of sentences feels grammatically incorrect. Even though some of the lines in your screenshot are more readable, they also look wrong to me (particularly the shorter lines in the first bullet), as though something glitched on the webpage. We can discuss this offline.

@taroface taroface enabled auto-merge (squash) September 27, 2024 18:45
@taroface taroface merged commit ed2bbaa into main Sep 27, 2024
6 checks passed
@taroface taroface deleted the mixed-isolation-levels branch September 27, 2024 19:13
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.

4 participants