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

docs: expand documentation on transactions #1539

Merged
merged 5 commits into from
Jun 23, 2021

Conversation

schmidt-sebastian
Copy link
Contributor

Fixes #1221

@schmidt-sebastian schmidt-sebastian requested review from a team as code owners June 22, 2021 21:39
@product-auto-label product-auto-label bot added the api: firestore Issues related to the googleapis/nodejs-firestore API. label Jun 22, 2021
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Jun 22, 2021
dev/src/index.ts Outdated
* out or fails for any reason.
*
* Transactions are committed once 'updateFunction' resolves. If a transaction
* fails with contention, the transaction is retried five up to five times and

Choose a reason for hiding this comment

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

"transaction is retried up to five times"

Also, the current wording makes it seem that the updateFunction is only invoked after the retries are completed, which could be misleading.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed the wording.

dev/src/index.ts Outdated
* fails with contention, the transaction is retried five up to five times and
* its `updateFunction` is invoked again.
*
* Transaction time out after 270 seconds or 60 seconds of after the last

Choose a reason for hiding this comment

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

nits:
s/Transaction/Transactions
s/60 seconds of after/seconds after
"last document is read"

Also, when does the timeout change from 60s to 270s? If a document is read in a tx, is the timeout window reduced to 60s + write-only tx timeout have a 270s timeout?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to:

   * Transactions time out after 60 seconds if no documents are read.
   * Transactions that are not committed within than 270 seconds are also
   * aborted.

@schmidt-sebastian schmidt-sebastian merged commit 2406f6a into master Jun 23, 2021
@schmidt-sebastian schmidt-sebastian deleted the mrschmidt/bettertransactiondocs branch June 23, 2021 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: firestore Issues related to the googleapis/nodejs-firestore API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve documentation about Transactions making emphasis on the pessimistic locks
2 participants