Repository navigation
fix(pnpr): prevent stale hosted packument writes - #12832
Conversation
Code Review by Qodo
1. Conflicts fail startup
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughThis PR adds optimistic concurrency for hosted packument writes. Storage now returns versioned packuments, callers use conditional writes, and journal recovery, publish commit, partial unpublish, and dist-tag updates retry on write conflicts. ChangesPackument write conflict handling
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant Server
participant Storage
participant S3Store
Client->>Server: publish or update request
Server->>Storage: read_hosted_packument_for_update
Storage->>S3Store: read_packument_for_update
S3Store-->>Storage: bytes + UpdateVersion
Storage-->>Server: bytes + base_version
Server->>Storage: write_hosted_packument_if_current
Storage->>S3Store: write_packument_if_current
S3Store-->>Storage: Written or Conflict
Storage-->>Server: PackumentWrite result
alt Conflict
Server-->>Client: 409 PackumentWriteConflict
else Written
Server-->>Client: success
end
Possibly related PRs
Suggested labels: Suggested reviewers: ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PR Summary by Qodofix(pnpr): prevent stale hosted packument writes via CAS
AI Description
Diagram
High-Level Assessment
Files changed (6)
|
Code Review by Qodo
Context used✅ Compliance rules (platform):
18 rules 1.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
pnpr/crates/pnpr/src/storage.rs (1)
241-262: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDocument that the Fs branch is an unconditional write (S3-only CAS).
write_packument_if_currentsilently ignoresversionon theFsbackend and always returnsWritten, so the "if current" precondition is a no-op there and conflict detection only exists for S3. That's fine for the single-node FS deployment, but the method name implies CAS on both backends; a future caller relying onPackumentWrite::Conflictfrom FS would be misled. A short doc comment on the method (or theFsarm) noting the FS write is unconditional would prevent that footgun.As per coding guidelines: "comment only when non-obvious invariants/workarounds/contract details are needed."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpr/crates/pnpr/src/storage.rs` around lines 241 - 262, The `write_packument_if_current` method in `HostedStore` has backend-specific behavior that is easy to miss: the `Fs` branch ignores the `version` precondition and always performs an unconditional write, while conflict detection only applies in the `S3` branch. Add a short doc comment on `write_packument_if_current` (or directly on the `HostedStore::Fs` match arm) that clearly states FS is always `Written` and CAS semantics are S3-only, so callers do not assume `PackumentWrite::Conflict` can come from FS.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pnpr/crates/pnpr/src/server.rs`:
- Around line 3595-3596: The only issue is that the inline comment in
`server.rs` is still written in Korean, which breaks the file’s English-only
comment baseline. Replace the existing comment near the dist-tag update logic
with an English translation that preserves the same meaning, and keep it aligned
with the surrounding Rust comment style used in `server.rs` and the related
dist-tag freshness handling code.
---
Nitpick comments:
In `@pnpr/crates/pnpr/src/storage.rs`:
- Around line 241-262: The `write_packument_if_current` method in `HostedStore`
has backend-specific behavior that is easy to miss: the `Fs` branch ignores the
`version` precondition and always performs an unconditional write, while
conflict detection only applies in the `S3` branch. Add a short doc comment on
`write_packument_if_current` (or directly on the `HostedStore::Fs` match arm)
that clearly states FS is always `Written` and CAS semantics are S3-only, so
callers do not assume `PackumentWrite::Conflict` can come from FS.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 249f4814-bc93-4734-bab4-9f7cf7e62916
📒 Files selected for processing (6)
pnpr/crates/pnpr/src/error.rspnpr/crates/pnpr/src/journal.rspnpr/crates/pnpr/src/s3.rspnpr/crates/pnpr/src/s3/tests.rspnpr/crates/pnpr/src/server.rspnpr/crates/pnpr/src/storage.rs
|
Code review by qodo was updated up to the latest commit 2e7e516 ⓘ You are approaching your monthly quota for Qodo. Upgrade your plan |
|
Code review by qodo was updated up to the latest commit 2e7e516 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #12832 +/- ##
==========================================
+ Coverage 85.18% 85.26% +0.08%
==========================================
Files 486 486
Lines 76975 77280 +305
==========================================
+ Hits 65570 65894 +324
+ Misses 11405 11386 -19 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Integrated-Benchmark Report (Linux)Commit: Each scenario reports direct installs and pnpr installs. Bencher consumes pacquet@HEAD and pnpr@HEAD. Scenario: Isolated linker: fresh restore, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 3.720264721880001,
"stddev": 0.20406605394214847,
"median": 3.6577941589800003,
"user": 3.59812652,
"system": 3.28331046,
"min": 3.5897467569800003,
"max": 4.25107374698,
"times": [
3.66211956298,
3.60712059998,
3.59729445498,
3.6983391089800004,
4.25107374698,
3.5965177279800002,
3.5897467569800003,
3.8703571769800003,
3.6766093279800005,
3.6534687549800005
]
},
{
"command": "pacquet@main",
"mean": 3.7221233238800004,
"stddev": 0.12100225295066137,
"median": 3.7233226899800003,
"user": 3.59774622,
"system": 3.2867332600000005,
"min": 3.55413383598,
"max": 3.9695747849800003,
"times": [
3.7069421529800004,
3.6359619849800002,
3.8085819739800004,
3.5927623729800002,
3.9695747849800003,
3.7758417249800003,
3.55413383598,
3.6586922159800004,
3.7790389649800002,
3.73970322698
]
},
{
"command": "pnpr@HEAD",
"mean": 2.08507053278,
"stddev": 0.07835595385340995,
"median": 2.10100283348,
"user": 2.73415172,
"system": 2.8960112600000003,
"min": 1.97536774898,
"max": 2.1976734609800004,
"times": [
2.16162485198,
2.0134232359800004,
2.07644333198,
2.1279628119800003,
2.0323731359800004,
1.9902244609800002,
2.12556233498,
1.97536774898,
2.1976734609800004,
2.1500499539800004
]
},
{
"command": "pnpr@main",
"mean": 2.11300264838,
"stddev": 0.12249018076499482,
"median": 2.10712891798,
"user": 2.7181008200000005,
"system": 2.9037353599999998,
"min": 1.92485529698,
"max": 2.29530434798,
"times": [
2.13547730798,
2.04594450098,
2.15884464298,
2.0787805279800002,
2.2839542069800003,
1.95757395198,
2.17193788498,
2.0773538149800004,
2.29530434798,
1.92485529698
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.64525028492,
"stddev": 0.011159391149856784,
"median": 0.6495315399200001,
"user": 0.37986964,
"system": 1.3166471199999998,
"min": 0.6255000229200001,
"max": 0.65859862392,
"times": [
0.64007195792,
0.6507158499200001,
0.6255000229200001,
0.65657639692,
0.6522271729200001,
0.6493558719200001,
0.6406573229200001,
0.64970720792,
0.62909242192,
0.65859862392
]
},
{
"command": "pacquet@main",
"mean": 0.6637183316200002,
"stddev": 0.06374014029761141,
"median": 0.65002651792,
"user": 0.38287924,
"system": 1.31471522,
"min": 0.6194221549200001,
"max": 0.8419327149200001,
"times": [
0.6381750339200001,
0.63300414092,
0.6549010579200001,
0.6194221549200001,
0.64599660792,
0.63868026992,
0.6540564279200001,
0.6555860829200001,
0.8419327149200001,
0.6554288249200001
]
},
{
"command": "pnpr@HEAD",
"mean": 0.6951612635200001,
"stddev": 0.014413416557797702,
"median": 0.69822437892,
"user": 0.39538313999999997,
"system": 1.34562722,
"min": 0.67492224292,
"max": 0.7115142069200001,
"times": [
0.67492224292,
0.6820581279200001,
0.7028540199200001,
0.68476596592,
0.70482239292,
0.69359473792,
0.67722412692,
0.7115142069200001,
0.7097280799200001,
0.7101287339200001
]
},
{
"command": "pnpr@main",
"mean": 0.72422312272,
"stddev": 0.0248249037891658,
"median": 0.7186854354200001,
"user": 0.39688094000000007,
"system": 1.36637072,
"min": 0.7035926709200001,
"max": 0.79197687492,
"times": [
0.7035926709200001,
0.7162182009200001,
0.72161999192,
0.72115266992,
0.71174989992,
0.71475413992,
0.79197687492,
0.7249552219200001,
0.7261491209200001,
0.7100624359200001
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.27520883758,
"stddev": 0.04537884768595714,
"median": 4.28006908728,
"user": 3.8375534799999995,
"system": 3.31298738,
"min": 4.21029540678,
"max": 4.37696896078,
"times": [
4.37696896078,
4.21029540678,
4.24365627778,
4.28183975578,
4.28684319378,
4.23628192578,
4.25342357078,
4.28199854478,
4.27829841878,
4.30248232078
]
},
{
"command": "pacquet@main",
"mean": 4.268477117480001,
"stddev": 0.06488286243896198,
"median": 4.25594363528,
"user": 3.81382798,
"system": 3.32456908,
"min": 4.2017861857800005,
"max": 4.430965569780001,
"times": [
4.2595788497800005,
4.22885402178,
4.25230842078,
4.27858280878,
4.22700248478,
4.22183888278,
4.2017861857800005,
4.28804672678,
4.430965569780001,
4.29580722378
]
},
{
"command": "pnpr@HEAD",
"mean": 2.2504658947800005,
"stddev": 0.13543096516329903,
"median": 2.3163593217800003,
"user": 2.56707118,
"system": 2.8097889799999995,
"min": 2.0102826617800003,
"max": 2.4281796697800004,
"times": [
2.1267185577800003,
2.33073324778,
2.0102826617800003,
2.0765501627800003,
2.3354113627800004,
2.4281796697800004,
2.2285835777800003,
2.3262279017800003,
2.33548106378,
2.3064907417800002
]
},
{
"command": "pnpr@main",
"mean": 2.23516163338,
"stddev": 0.14958509401570574,
"median": 2.21446363778,
"user": 2.583119279999999,
"system": 2.82669558,
"min": 2.05892434678,
"max": 2.42596357078,
"times": [
2.33639017078,
2.36259977578,
2.42596357078,
2.10111410378,
2.10963794878,
2.05892434678,
2.42088183278,
2.10766819478,
2.10914706278,
2.3192893267800003
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.3890699959800001,
"stddev": 0.014079367653012612,
"median": 1.38858421038,
"user": 1.32533498,
"system": 1.716366,
"min": 1.35989309288,
"max": 1.41139311188,
"times": [
1.41139311188,
1.38079295188,
1.38195775388,
1.40126138688,
1.40027741388,
1.38669736488,
1.39307090688,
1.35989309288,
1.39047105588,
1.38488492088
]
},
{
"command": "pacquet@main",
"mean": 1.39136352908,
"stddev": 0.021764365156572502,
"median": 1.38794122988,
"user": 1.3280575799999998,
"system": 1.7030650999999999,
"min": 1.36658764588,
"max": 1.44408158088,
"times": [
1.36658764588,
1.38990725588,
1.44408158088,
1.39032124788,
1.37498563488,
1.40266322888,
1.40026863088,
1.38564780988,
1.37319705188,
1.38597520388
]
},
{
"command": "pnpr@HEAD",
"mean": 0.69915004278,
"stddev": 0.08417237564454957,
"median": 0.67247590538,
"user": 0.34677467999999995,
"system": 1.2930709,
"min": 0.6617748988800001,
"max": 0.9375940178800001,
"times": [
0.66518224388,
0.66561462888,
0.6617748988800001,
0.67367957988,
0.9375940178800001,
0.68217925688,
0.68581459788,
0.67127223088,
0.6672405208800001,
0.6811484518800001
]
},
{
"command": "pnpr@main",
"mean": 0.68153383468,
"stddev": 0.04733592030594531,
"median": 0.66797713888,
"user": 0.33845907999999997,
"system": 1.2900904000000002,
"min": 0.64888074388,
"max": 0.81317295288,
"times": [
0.68395099088,
0.6684097088800001,
0.64888074388,
0.6773930448800001,
0.66754456888,
0.66526179488,
0.67243836688,
0.81317295288,
0.6630156458800001,
0.65527052888
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 3.0881863800399993,
"stddev": 0.019727328273569742,
"median": 3.08901429234,
"user": 1.78876396,
"system": 2.00803002,
"min": 3.05249635284,
"max": 3.11675363484,
"times": [
3.11375937084,
3.0887813608399997,
3.05249635284,
3.0892472238399997,
3.07096966784,
3.11675363484,
3.0941937618399997,
3.0997740008399997,
3.0842925698399997,
3.0715958568399997
]
},
{
"command": "pacquet@main",
"mean": 3.07674006804,
"stddev": 0.039143034554572,
"median": 3.0663303953399996,
"user": 1.7744265599999998,
"system": 1.9988612199999998,
"min": 3.0486409438399997,
"max": 3.17877086284,
"times": [
3.0486409438399997,
3.0525373558399997,
3.04929947184,
3.06275899684,
3.0699017938399997,
3.08851741784,
3.05089684784,
3.17877086284,
3.0908756568399998,
3.07520133284
]
},
{
"command": "pnpr@HEAD",
"mean": 0.6717712766400001,
"stddev": 0.009338188430183605,
"median": 0.6716739848400001,
"user": 0.33652656,
"system": 1.30563732,
"min": 0.6592303888400001,
"max": 0.6891520778400001,
"times": [
0.67380744284,
0.6688053648400001,
0.6592303888400001,
0.6779432898400001,
0.6776330598400001,
0.66456496884,
0.65951849384,
0.6695405268400001,
0.6891520778400001,
0.6775171528400001
]
},
{
"command": "pnpr@main",
"mean": 0.7035824367400001,
"stddev": 0.08532691365265403,
"median": 0.6700287168400001,
"user": 0.33967556,
"system": 1.28516732,
"min": 0.6546971048400001,
"max": 0.9373113638400001,
"times": [
0.6716053178400001,
0.6597485798400001,
0.6546971048400001,
0.6684521158400001,
0.6655795808400001,
0.7282675328400001,
0.6675956998400001,
0.9373113638400001,
0.70969450984,
0.6728725618400001
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.6870179013800001,
"stddev": 0.03825484072692797,
"median": 0.67156342118,
"user": 0.6273575600000001,
"system": 0.15720037999999997,
"min": 0.65665182818,
"max": 0.7722745441800001,
"times": [
0.7722745441800001,
0.72556668818,
0.71440844618,
0.65670945118,
0.66948027718,
0.65665182818,
0.66697521218,
0.67364656518,
0.67601633918,
0.65844966218
]
},
{
"command": "pacquet@main",
"mean": 0.6703052374799999,
"stddev": 0.008715950104231422,
"median": 0.66968492918,
"user": 0.63203786,
"system": 0.14813887999999997,
"min": 0.66076197018,
"max": 0.69248495418,
"times": [
0.67136785718,
0.67236492518,
0.66754411118,
0.66341338218,
0.66420169418,
0.66911619018,
0.66076197018,
0.69248495418,
0.6715436221800001,
0.67025366818
]
},
{
"command": "pnpr@HEAD",
"mean": 0.11238605743000002,
"stddev": 0.0007305611161187812,
"median": 0.11225799068,
"user": 0.029059134999999996,
"system": 0.022343638333333332,
"min": 0.11161459718,
"max": 0.11503251318,
"times": [
0.11503251318,
0.11191268818,
0.11274577818,
0.11226840118,
0.11224758018,
0.11211694718,
0.11232023518,
0.11270298318000001,
0.11183547118,
0.11182702818,
0.11162329018,
0.11248335718000001,
0.11230526218,
0.11161459718,
0.11247242018,
0.11229610818,
0.11189970818,
0.11211608618,
0.11320562418,
0.11202199318,
0.11299928218000001,
0.11202786718,
0.11182742418,
0.11336273218
]
},
{
"command": "pnpr@main",
"mean": 0.11245982247166665,
"stddev": 0.0005861825960561872,
"median": 0.11235137468,
"user": 0.029044801666666672,
"system": 0.02251551333333333,
"min": 0.11164618518,
"max": 0.11416108518,
"times": [
0.11293851518,
0.11226956818,
0.11184286218,
0.11243318118000001,
0.11219807518,
0.11298374318,
0.11194064518,
0.11277861818,
0.11164618518,
0.11250490418,
0.11244058718,
0.11217337218000001,
0.11322119718,
0.11219310318,
0.11261757518,
0.11200641018,
0.11252893018,
0.11284006118,
0.11189033918,
0.11341175618,
0.11202030618,
0.11416108518,
0.11189903318,
0.11209568518
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 6.597735235819999,
"stddev": 0.1835422412796193,
"median": 6.575175226520001,
"user": 3.8443526000000006,
"system": 3.5801662399999996,
"min": 6.34780000452,
"max": 6.90764762452,
"times": [
6.80668050752,
6.60085083252,
6.412482664520001,
6.40462608052,
6.65759891852,
6.549499620520001,
6.34780000452,
6.7425638695200005,
6.54760223552,
6.90764762452
]
},
{
"command": "pacquet@main",
"mean": 6.61684599072,
"stddev": 0.1524408173094249,
"median": 6.54522677102,
"user": 3.8693435000000007,
"system": 3.5562852400000002,
"min": 6.463334312520001,
"max": 6.88612833152,
"times": [
6.542368901520001,
6.68856952352,
6.54808464052,
6.46897907452,
6.463334312520001,
6.52798291952,
6.88612833152,
6.48940754752,
6.7921629685200005,
6.7614416875200005
]
},
{
"command": "pnpr@HEAD",
"mean": 4.874501111120001,
"stddev": 0.11383927997312168,
"median": 4.866636506020001,
"user": 2.8779561,
"system": 3.1216222399999998,
"min": 4.67407062952,
"max": 5.08193301852,
"times": [
4.792149337520001,
4.83125287852,
4.80419534152,
4.90478601352,
4.93912633752,
4.98448037952,
5.08193301852,
4.902020133520001,
4.83099704152,
4.67407062952
]
},
{
"command": "pnpr@main",
"mean": 4.82253083142,
"stddev": 0.06189973103427972,
"median": 4.820319186520001,
"user": 2.843244,
"system": 3.1258440399999996,
"min": 4.74608488852,
"max": 4.93688993352,
"times": [
4.83783261752,
4.75842581852,
4.89831723152,
4.84807923752,
4.74608488852,
4.84158937552,
4.77317310752,
4.78211034852,
4.8028057555200006,
4.93688993352
]
}
]
} |
|
| Branch | pr/12832 |
| Testbed | pnpr |
⚠️ WARNING: No Threshold found!Without a Threshold, no Alerts will ever be generated.
Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the--ci-only-thresholdsflag.
Click to view all benchmark results
| Benchmark | Latency | milliseconds (ms) |
|---|---|---|
| isolated-linker.fresh-install.cold-cache.cold-store | 📈 view plot | 2,250.47 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 671.77 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 699.15 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 112.39 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 2,085.07 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 4,874.50 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 695.16 ms |
|
Code review by qodo was updated up to the latest commit 67f67da ⓘ You are approaching your monthly quota for Qodo. Upgrade your plan |
1 similar comment
|
Code review by qodo was updated up to the latest commit 67f67da ⓘ You are approaching your monthly quota for Qodo. Upgrade your plan |
|
Code review by qodo was updated up to the latest commit 67f67da |
1 similar comment
|
Code review by qodo was updated up to the latest commit 67f67da |
|
Addressed the CodeRabbit storage nitpick in 67f67da by documenting that the FS hosted store path always returns |
|
Qodo review follow-up pushed in Fixed:
Skipped after verification:
Validation:
Pre-push note: the hook skipped Rust checks because Written by an agent (Codex, GPT-5). |
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
Use hosted packument object versions for compare-and-swap writes. This keeps shared S3-backed pnpr replicas from overwriting merged manifests. Retry dist-tag and journal roll-forward writes by rereading and re-merging. Surface repeated packument conflicts as HTTP 409.
1a0f9df to
eb05f8e
Compare
|
Code review by qodo was updated up to the latest commit eb05f8e |
PR Code Suggestions ✨Latest suggestions up to 848c2a4 Warning
Previous suggestionsSuggestions up to commit 24a6265
Suggestions up to commit 9939d7c
Suggestions up to commit eb05f8e
|
||||||||||||||||||||||||||||||||||||||||||||
Confidence Score: 5/5The change is self-contained to pnpr's S3 backend and journal recovery; the FS path and all TypeScript CLI code are untouched. Logic is well-covered by new unit and integration tests. The CAS semantics are correctly threaded through all write sites (publish commit, partial unpublish, dist-tag, recovery). The retry loop bounds are conservative, the FnMut closure broadening is backward-compatible, and the tarball byte-identity check handles the TOCTOU trade-off acceptably. The only finding is Korean-language comments inconsistent with the project's English convention, which has no runtime impact. The Korean comments in journal.rs and journal/tests.rs should be translated to English before merge. Reviews (6): Last reviewed commit: "test(pnpr): remove trailing comma reject..." | Re-trigger Greptile |
The pnpr dylint rule set rejects inline `#[cfg(test)] mod tests { ... }`
blocks, so the drop_conflicted_versions tests move to journal/tests.rs,
matching the crate's other modules.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Code review by qodo was updated up to the latest commit 848c2a4 |
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
1 similar comment
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
163cdd9 to
1179e22
Compare
Summary
Fix a lost-update risk in pnpr's S3-backed hosted store when multiple replicas update the
same hosted packument, and close the related tarball-overwrite race.
partial unpublish reject or retry stale writes.
journal roll-forward through a single
Storage::update_hosted_packument_with_retryhelper.PutMode::Create, byte-identical-tolerant): alosing concurrent same-version publish can no longer overwrite the winner's tarball and
corrupt it against the integrity the winner's packument records.
This is a pnpr registry-server-only change; no TypeScript CLI or pacquet porting is needed.
Verified with:
cargo fmt --package pnpr -- --checkcargo clippy -p pnpr --all-targets -- --deny warningscargo test -p pnpr(full suite: 617 passed)cargo test -p pnpr stale_packument_update_is_rejectedcargo test -p pnpr concurrent_tarball_finalize_does_not_overwritecargo test -p pnpr --test s3_backendcargo test -p pnpr --test journal_recoverycargo test -p pnpr --test batch_publishcargo test -p pnpr --test staged_publishcargo test -p pnpr --test auth_publishcargo test -p pnpr dist_tagSquash Commit Body
Checklist
Written by an agent (Codex, GPT-5).
Follow-up review fixes (retry-loop dedup, tarball compare-and-swap) by an agent (Claude Code, claude-opus-4-8).
Summary by CodeRabbit