Skip to content

[db-sync] Introduce SyncPeriod (with upper limit now - 5s) #14568

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

Merged
merged 3 commits into from
Nov 14, 2022

Conversation

geropl
Copy link
Member

@geropl geropl commented Nov 9, 2022

Description

This intended to be a small and pragmatic fix to db-sync to make it more reliable before we can retire it completely.
Before, it would always sync from ´[previousRun, ...now`. Also, it was using the local processes clock, which is obviously out-of-sync with the DB's.

This PR addresses this by:

  • introducing an upperBound of "now - 5s" for SyncPeriods
  • use the DB's clock to establish that SyncPeriod
  • (fix a minor comparison error in export.ts which made us double-sync on millisecond matches)

Related Issue(s)

Fixes #14560

How to test

  • leeway build components/gitpod-db:dbtest-init
  • (components/ee/db-sync && yarn db-test)

Release Notes

NONE

Documentation

Werft options:

  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-large-vm
  • /werft with-integration-tests=all
    Valid options are all, workspace, webapp, ide, jetbrains, vscode, ssh

@geropl geropl force-pushed the gpl/14560-lost-updates branch from 4c81578 to e895705 Compare November 11, 2022 16:10
@geropl geropl marked this pull request as ready for review November 11, 2022 16:18
@geropl geropl requested a review from a team November 11, 2022 16:18
@github-actions github-actions bot added the team: webapp Issue belongs to the WebApp team label Nov 11, 2022
@geropl
Copy link
Member Author

geropl commented Nov 11, 2022

/hold For further reviews and testing.

@geropl geropl changed the title [db-sync] Small refactoring to prepare for bounded syncs [db-sync] Introduce SyncPeriod (with upper limit now - 5s) Nov 11, 2022
Copy link
Member

@easyCZ easyCZ left a comment

Choose a reason for hiding this comment

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

Looks sensible

@geropl geropl force-pushed the gpl/14560-lost-updates branch from e895705 to 361fbb8 Compare November 14, 2022 12:59
@roboquat roboquat added size/L and removed size/M labels Nov 14, 2022
@geropl
Copy link
Member Author

geropl commented Nov 14, 2022

Did a small change to avoid eating Errors by accident. Will test in staging once the build has finished.

@geropl
Copy link
Member Author

geropl commented Nov 14, 2022

/unhold

Testing on staging looking good.

@roboquat roboquat merged commit aad63f4 into main Nov 14, 2022
@roboquat roboquat deleted the gpl/14560-lost-updates branch November 14, 2022 13:52
@roboquat roboquat added deployed: webapp Meta team change is running in production deployed Change is completely running in production labels Nov 14, 2022
@geropl geropl mentioned this pull request Nov 14, 2022
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: webapp Meta team change is running in production deployed Change is completely running in production release-note-none size/L team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[db-sync] Fix potential lost update
3 participants