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 bookmark when starting a transaction #303

Merged
merged 1 commit into from
Jan 5, 2017

Conversation

lutovich
Copy link
Contributor

@lutovich lutovich commented Jan 4, 2017

It is possible to specify bookmark when starting a transaction. First BEGIN statement would then contain the given bookmark in params. Database will wait when processing such BEGIN for the state described by the bookmark to appear.

Sending BEGIN and bookmark was previously lazy. So it was possible to start a transaction with an invalid/unreachable bookmark. Error would in such case pop up only after the next sync (commit or consume) which is too late and can be quite confusing.

This PR makes transaction eagerly send BEGIN and PULL_ALL messages when non-null bookmark is given. It makes session#beginTransaction("bookmark") call blocking but the API less surprising.

It is possible to specify bookmark when starting a transaction. First `BEGIN`
statement would then contain the given bookmark in params. Database will wait
when processing such `BEGIN` for the state described by the bookmark to appear.

Sending `BEGIN` and bookmark was previously lazy. So it was possible to start
a transaction with an invalid/unreachable bookmark. Error would in such case
pop up only after the next sync (commit or consume) which is too late and can
be quite confusing.

This commit makes transaction eagerly send `BEGIN` and `PULL_ALL` messages
when non-null bookmark is given. It makes `session#beginTransaction("bookmark")`
call blocking but the API less surprising.
@lutovich lutovich force-pushed the 1.1-block-for-bookmark branch from 2ea8bf8 to f6222c7 Compare January 5, 2017 13:28
@zhenlineo zhenlineo merged commit 3ca3290 into 1.1 Jan 5, 2017
@zhenlineo zhenlineo deleted the 1.1-block-for-bookmark branch January 5, 2017 15:51
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