Project

General

Profile

Actions

Bug #22791

closed

file uploads via s3 interface are not protected from races

Added by Tom Clegg 11 months ago. Updated 6 months ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
Keep
Target version:
Story points:
-
Release relationship:
Auto

Description

While testing #22321 on tordo I used aws s3 cp to upload 312 files. The resulting collection had only 17 files.

When we started using the replace_files API for race-safe writes in #21702, we didn't do this in the S3 code path.

AFAICT this is not a regression because before #21702, we didn't use the previous "one writer per collection per keep-web process" lock in the S3 code path either.


Subtasks 1 (0 open1 closed)

Task #22805: Review 22791-s3-upload-concurrencyResolvedTom Clegg05/26/2025Actions
Actions #1

Updated by Peter Amstutz 11 months ago

  • Target version changed from Development 2025-04-16 to Development 2025-04-30
Actions #2

Updated by Peter Amstutz 11 months ago

  • Subtask #22805 added
Actions #3

Updated by Peter Amstutz 11 months ago

  • Target version changed from Development 2025-04-30 to Development 2025-05-14
Actions #4

Updated by Tom Clegg 10 months ago

  • Status changed from New to In Progress
Actions #5

Updated by Tom Clegg 10 months ago

  • Target version changed from Development 2025-05-14 to Development 2025-05-28
Actions #7

Updated by Tom Clegg 10 months ago

22791-s3-upload-concurrency @ f3a8012a3f7e81e891ab6ba9cbb734bd49c632bb -- developer-run-tests: #4780

Failure seems unrelated:

FAIL: singularity_test.go:245: singularitySuite.TestImageCache_Concurrency_10
...
INFO:    Creating SIF file...
FATAL:   While performing build: while creating SIF: while creating container: open /tmp/check-1596490754/26/by_uuid/zzzzz-4zz18-mkdap9nefs0fjr6/image.sif: no such file or directory

singularity_test.go:270:
    c.Check(err, IsNil)
... value *exec.ExitError = &exec.ExitError{ProcessState:(*os.ProcessState)(0xc004097158), Stderr:[]uint8(nil)} ("exit status 255")

(this might be a real unrelated issue, although I haven't been able to reproduce it locally yet)

Actions #8

Updated by Tom Clegg 10 months ago

22791-s3-upload-concurrency @ f3a8012a3f7e81e891ab6ba9cbb734bd49c632bb -- developer-run-tests: #4781

  • All agreed upon points are implemented / addressed. Describe changes from pre-implementation design.
    • ✅ file uploads via keep-web's s3 interface are race-safe
    • ✨ file deletions via keep-web's s3 interface are race-safe
    • Approach is the same as the WebDAV code path: use replace_files for uploading (instead of writing them to the cached filesystem), and subsequent downloads use needSync() to detect whether the cached filesystem needs to be refreshed
  • Anything not implemented (discovered or discussed during work) has a follow-up story.
    • n/a
  • Code is tested and passing, both automated and manual, what manual testing was done is described.
    • ✅ Added a test for concurrent uploads via S3
  • New or changed UX/UX and has gotten feedback from stakeholders.
    • n/a
  • Documentation has been updated.
    • n/a
  • Behaves appropriately at the intended scale (describe intended scale).
    • ✅ Performance should be the same as for WebDAV uploads
  • Considered backwards and forwards compatibility issues between client and server.
    • ✅ No concerns, the previous version of keep-web already depended on the replace_files API for WebDAV uploads
  • Follows our coding standards and GUI style guidelines.
Actions #9

Updated by Brett Smith 10 months ago

Tom Clegg wrote in #note-8:

22791-s3-upload-concurrency @ f3a8012a3f7e81e891ab6ba9cbb734bd49c632bb -- developer-run-tests: #4781

LGTM, thanks.

Actions #10

Updated by Tom Clegg 10 months ago

  • Status changed from In Progress to Resolved
Actions #11

Updated by Brett Smith 6 months ago

  • Release set to 79
Actions

Also available in: Atom PDF