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

Add synchronous request reply design doc #2216

Merged

Conversation

andrewjdawson2016
Copy link
Contributor

No description provided.

@@ -0,0 +1,102 @@
# Proposal: Synchronous Request Reply

Authors: Maxim Fateev (mfateev), Andrew Dawson (andrewjdawson2016)
Copy link
Contributor

Choose a reason for hiding this comment

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

Put the @ symbol in front of the aliases so GitHub links them

### Guarantee read after write consistency between signal and query

Currently there are situations when a query emitted after a signal sees a stale workflow state without the signal update yet delivered. This forces complications to a workflow logic as signal then query for updated state interaction pattern is not consistent. After this race condition is fixed signal then query can be used for request-reply like scenarios. The drawback of this approach is that it is not most optimal from the performance point of view as it requires at least two decisions and multiple database updates. But together with Long poll on query result changes feature it is a reasonable way to implement update and then wait for a long running update operations.

Copy link
Contributor

Choose a reason for hiding this comment

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

Fix a few typos in the paragraph above to make it easier to read:

Currently, there is a race condition when a query emitted after a signal sees a stale workflow state without the update from the signal. Accounting for this inconsistency complicates the workflow logic. Fixing this race condition allows the signal-then-query pattern to be used for request-reply scenarios. The drawback of this approach is suboptimal performance since it requires at least two decisions and multiple database updates. But, together with the long polling on query result changes feature, it is a reasonable way to implement update-and-wait for long-running update operations.

@andrewjdawson2016 andrewjdawson2016 merged commit 4f35963 into cadence-workflow:master Jul 17, 2019
@andrewjdawson2016 andrewjdawson2016 deleted the sync-rr-design-doc branch July 17, 2019 16: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.

3 participants