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

Make search sync asynchronous when merging orgs #2053

Merged
merged 1 commit into from
Jan 10, 2024

Conversation

sausage-todd
Copy link
Contributor

There are two issues with search sync being synchronous right now:

  1. It might take longer to sync to search than to execute a finalizing
    temporal workflow. If this happens, temporal workflow will notify
    frontend about finishing org merging before this method returns. This
    means, frontend learns about org merging being done before it learns
    the org merging even started.
  2. Synchronous search sync might fail. Since we execute it outside of a
    database transaction, the error frontend sees will be misleading.
    Because, on one hand, the request to merge orgs failed, but on the
    other hand it actually did something, transaction got commited, it
    can't be retried.

As a result, the solution:

  1. Make search sync asynchronous, so it doesn't fail (or fails much less
    often)
  2. Execute it before starting executing temporal workflow. So there is
    as little delay as possible between starting a temporal workflow and
    returning something to frontend

There are two issues with search sync being synchronous right now:
1. It might take longer to sync to search than to execute a finalizing
   temporal workflow. If this happens, temporal workflow will notify
   frontend about finishing org merging before this method returns. This
   means, frontend learns about org merging being done before it learns
   the org merging even started.
2. Synchronous search sync might fail. Since we execute it outside of a
   database transaction, the error frontend sees will be misleading.
   Because, on one hand, the request to merge orgs failed, but on the
   other hand it actually did something, transaction got commited, it
   can't be retried.

As a result, the solution:
1. Make search sync asynchronous, so it doesn't fail (or fails much less
   often)
2. Execute it before starting executing temporal workflow. So there is
   as little delay as possible between starting a temporal workflow and
   returning something to frontend
@sausage-todd sausage-todd merged commit b965648 into main Jan 10, 2024
8 checks passed
@sausage-todd sausage-todd deleted the org-merge-search-sync branch January 10, 2024 08:49
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.

1 participant