Skip to content

fix(server): return SQLite write versions atomically - #4408

Open
ericcurtin wants to merge 1 commit into
NVIDIA:mainfrom
ericcurtin:fix/4401-sqlite-write-returning/ericcurtin
Open

ericcurtin wants to merge 1 commit into
NVIDIA:mainfrom
ericcurtin:fix/4401-sqlite-write-returning/ericcurtin

Conversation

@ericcurtin

Copy link
Copy Markdown
Contributor

Summary

SQLite put_if returned the version of a later writer. Use RETURNING, as Postgres does.

Related Issue

Closes #4401

Changes

  • RETURNING for version-checked updates and unconditional upserts.
  • Shared write_result_from_row helper.
  • Concurrent writer test.

Testing

  • Checks appropriate to the affected code and behavior pass
  • Unit tests added/updated (if applicable)
  • E2E tests added/updated (if applicable)

cargo fmt, cargo clippy --all-targets and cargo test --lib for openshell-server. The new test fails (duplicate versions) without the change.

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (if applicable)

Use RETURNING instead of a follow-up read.

Signed-off-by: Eric Curtin <eric.curtin@docker.com>
@copy-pr-bot

copy-pr-bot Bot commented Oct 11, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@ericcurtin

Copy link
Copy Markdown
Contributor Author

@johntmyers @elezar PTAL when you get a chance, and /ok to test b7b318366d882887c088b8a9b66de5632a13b7a2 if it looks good. Thank you!

This branch has not been deployed

No deployments
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.

bug: SQLite writes can return the wrong resource version

1 participant