Skip to content

Release 2026.4.0#620

Merged
MarcelGeo merged 21 commits intomasterfrom
develop
May 6, 2026
Merged

Release 2026.4.0#620
MarcelGeo merged 21 commits intomasterfrom
develop

Conversation

@MarcelGeo
Copy link
Copy Markdown
Collaborator

No description provided.

xkello and others added 19 commits April 11, 2026 18:46
This is a refactoring that replaces the filesystem-based Toucher/lockfile mechanism with a database-based heartbeat approach for tracking active uploads.
This eliminates the NFS-specific hack (os.access() + os.utime()) that was needed to bust NFS attribute caches in the old approach. The new approach is cleaner and more cloud-native.
Replace the old try/except IntegrityError + cleanup loop pattern with an atomic upsert in Upload.create_upload().
Decouple the upload directory name from the DB primary key via transaction_id. Upload directory is created at this stage, no need to take care for it later.

With the upsert logic, the ObjectDeletedError scenario which happened because a concurrent request could delete a stale upload row mid-operation is eliminated:
  - During push_finish, the heartbeat context manager continuously updates last_ping, keeping the upload fresh
  throughout the operation
  - A concurrent request can only take over an upload whose last_ping has expired
  - Since heartbeat prevents expiry, no other request can claim the row while push_finish is running
  - The upload object therefore stays valid for the full lifetime of the request — ObjectDeletedError becomes
  impossible
We keep responses untouched, the only change happens on DB / model side to avoid excessive joins.
Merge user_profile into user table
- guard against transaction folder errors
- make last_ping tz naive
- set transaction id to uuid type
- remove redundant is_active method
… versions in DB

If os.rename failed for moving uploaded data we would end up in broken project with project version in DB but no actual data.
Backport master to develop
Fix upload migrations and merge into single transaction
Handle rename error in case of full disk
@MarcelGeo MarcelGeo requested a review from varmar05 May 6, 2026 12:30
@coveralls
Copy link
Copy Markdown

Coverage Report for CI Build 25435622208

Coverage decreased (-0.09%) to 93.214%

Details

  • Coverage decreased (-0.09%) from the base build.
  • Patch coverage: 23 uncovered changes across 3 files (213 of 236 lines covered, 90.25%).
  • 7 coverage regressions across 2 files.

Uncovered Changes

File Changed Covered %
server/mergin/sync/public_api_v2_controller.py 32 22 68.75%
server/mergin/sync/models.py 57 49 85.96%
server/mergin/sync/public_api_controller.py 32 27 84.38%

Coverage Regressions

7 previously-covered lines in 2 files lost coverage.

File Lines Losing Coverage Coverage
server/mergin/sync/models.py 5 92.77%
server/mergin/sync/public_api_controller.py 2 92.44%

Coverage Stats

Coverage Status
Relevant Lines: 9829
Covered Lines: 9162
Line Coverage: 93.21%
Coverage Strength: 0.93 hits per line

💛 - Coveralls

@MarcelGeo MarcelGeo merged commit a9b93c2 into master May 6, 2026
4 checks passed
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