Skip to content

fix(quark): preserve post-upload identity across stale listings - #9664

Merged
okatu-loli merged 2 commits into
AlistGo:mainfrom
NovumOrbis:fix/quark-post-put-visibility-clean-20261004
Oct 13, 2026
Merged

okatu-loli merged 2 commits into
AlistGo:mainfrom
NovumOrbis:fix/quark-post-put-visibility-clean-20261004

Conversation

@NovumOrbis

@NovumOrbis NovumOrbis commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Preserve the identity of a successfully uploaded Quark/UC object across a short post-upload stale-listing window.

Quark may acknowledge an upload successfully while its directory listing still temporarily omits the newly created object. An immediate follow-up operation such as WebDAV DELETE can therefore fail during path resolution even though the upload itself succeeded.

Problem

Observed sequence:

  1. WebDAV PUT succeeds with 201 Created.
  2. Shortly afterwards, the same path is looked up again.
  3. Quark's directory listing does not yet contain the newly uploaded object.
  4. AList reports ObjectNotFound, so the follow-up DELETE cannot reach
    driver.Remove.

This is a read-after-write visibility issue rather than an upload failure.

Changes

  • Make the Quark/UC driver implement driver.PutResult.
  • Return the exact PRE-allocated FID only after the upload succeeds.
  • Add a bounded recent-write identity bridge in internal/op.

The bridge is keyed by:

  • storage ID
  • mount path
  • stable parent directory ID
  • child name

and expires after one minute.

Normal provider/list lookup always runs first. The recent-write identity is used only as a fallback when the normal lookup succeeds but does not contain the recently written object.

Successful Remove invalidates the relevant recent-write identity. Rename/Move invalidate the source identity, and result-returning variants seed the destination only when they provide an authoritative non-nil object.

Safety

The bridge is bound to stable parent identity rather than pathname, preventing a child from being rebound to a newly-created same-name directory after the original parent is renamed, moved, or removed.

The change does not:

Validation

Validated on the current main + PR merge result with:

  • go test ./drivers/quark_uc
  • go test -race ./drivers/quark_uc
  • go vet ./drivers/quark_uc
  • go test ./internal/op
  • go test -race ./internal/op
  • go vet ./internal/op
  • go test ./server/webdav
  • go test -race ./server/webdav
  • go vet ./server/webdav
  • targeted post-upload regression tests repeated 50 times
  • targeted race tests repeated 10 times
  • parent rename/move/remove + same-name recreation safety probes
  • NoOverwriteUpload success and rollback probes
  • gofmt
  • git diff --check

No real Quark/UC provider traffic was used during validation.

Related

@NovumOrbis
NovumOrbis force-pushed the fix/quark-post-put-visibility-clean-20261004 branch from c5d174b to bfa46d2 Compare October 5, 2026 16:14
@NovumOrbis
NovumOrbis marked this pull request as ready for review October 6, 2026 01:35
@okatu-loli
okatu-loli merged commit 2e6beff into AlistGo:main Oct 13, 2026
12 checks passed
@NovumOrbis
NovumOrbis deleted the fix/quark-post-put-visibility-clean-20261004 branch October 16, 2026 10:44
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.

3 participants