Skip to content

Fix push finish on racing conditions - #479

Merged
MarcelGeo merged 2 commits into
dev-r65-pushfrom
fix_upload_version_collision
Jul 16, 2025
Merged

Fix push finish on racing conditions#479
MarcelGeo merged 2 commits into
dev-r65-pushfrom
fix_upload_version_collision

Conversation

@varmar05

@varmar05 varmar05 commented Jul 15, 2025

Copy link
Copy Markdown
Collaborator

Server determines the next version on push finish just before moving files which were already prepared (including geodiff acttions). This should address the issue when during push finish another version is already created.

Workflow in push finish is changed that all hard work is done before final version check.

Example:

  • on push finish server is currently on v4
  • during chunks merge someone else created v5 version
  • before commit to db server would bump to v6 for current push finish and move already created files to correct destination

When during push finish target version is already created, server would bump target version
@varmar05
varmar05 requested review from MarcelGeo and harminius July 15, 2025 08:14
@coveralls

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 16287797316

Details

  • 63 of 67 (94.03%) changed or added relevant lines in 4 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.02%) to 91.847%

Changes Missing Coverage Covered Lines Changed/Added Lines %
server/mergin/sync/public_api_controller.py 47 51 92.16%
Files with Coverage Reduction New Missed Lines %
server/mergin/sync/public_api_controller.py 1 91.21%
Totals Coverage Status
Change from base Build 16074058805: -0.02%
Covered Lines: 7221
Relevant Lines: 7862

💛 - Coveralls

@harminius

Copy link
Copy Markdown
Contributor

When running concurrent sync tests from plugin I still keep hitting the db constraint when committing the same version (see client B log). Could we reintroduce the 409 error code so that client can retry?

B_client-log.txt
A_client-log.txt

contains small refactoring and asking for version to be created only once
@varmar05
varmar05 changed the base branch from develop to dev-r65-push July 15, 2025 14:14
@MarcelGeo

Copy link
Copy Markdown
Collaborator

When running concurrent sync tests from plugin I still keep hitting the db constraint when committing the same version (see client B log). Could we reintroduce the 409 error code so that client can retry?

B_client-log.txt A_client-log.txt

I'm not sure what you think regarding to logs :) But we will rewrite some logic in sync. We need to reintroduce harder versions check to push start to prevent going to push finish with invalid versions.

@MarcelGeo
MarcelGeo merged commit 071a19d into dev-r65-push Jul 16, 2025
4 checks passed
@MarcelGeo
MarcelGeo deleted the fix_upload_version_collision branch July 16, 2025 11:08
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.

4 participants