Repository navigation
Antalya 26.8 BACKUP of CAS tables to S3 on the same endpoint - #2508
Conversation
PR #2508 CI Verification
VerdictCI did not run. Approval is blocked until it does. The new integration module What was checkedRe-verified 2026-10-21 against
The last row widens the problem: the base branch has never been built either, so there is no REF report to compare against and no cached build to reuse. Why it did not start
pull_request:
branches: ['antalya', 'releases/*', 'antalya-*', 'stable-*']
The draft state is not the cause. The workflow declares no
The PR body selects the CAS, Iceberg, OAuth, Parquet, S3 Export, and Swarms regression jobs and excludes aarch64, TSan, MSan, and coverage. Those checkboxes are read by Routes to an actual run
PR #2508 is the only pull request ever opened against RecommendationRetarget onto a base the workflow watches, or merge What matters most is that |
PR #2508 Audit Review
VerdictNo defects found. The offset arithmetic is correct, and every guard fails in the safe direction. Three points below still warrant attention. Worth acting on1. The
This is a static conclusion, not a reproduced one — but this PR's own If it holds, it belongs in the changelog entry: anyone who moved partitions off a CAS disk onto a plain S3 disk on the same endpoint has corrupt data, and will not look for that under a backup fix. 2. An It is not reachable today: 3. The
Established by review
Gaps in the test coverageNot blockers — simply what
CINothing ran. One check on this head: DCO. No build, no integration result, no regression result, and
|
BACKUP of CAS tables to S3 on the same endpoint Signed-off-by: Konstantin Morozov <[email protected]>
CAS backup blobs less 5mb: a CAS blob whose source object is not greater than 5 MB is copied through buffers, because S3 accepts a byte range on `UploadPartCopy` only from a source object greater than 5 MB. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Konstantin Morozov <[email protected]>
`copyS3File` lost its offset argument: a whole-object copy and a ranged copy are now two separate functions. A CAS blob is `[envelope][payload]`, so its copy is always ranged. Pass the blob size from the view plan as the source object size. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Konstantin Morozov <[email protected]>
…fers S3 accepts a byte range in `UploadPartCopy` only from a source object greater than 5 MB, so such a blob is read through the `CAS` read path. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Konstantin Morozov <[email protected]>
Upstream now has a ranged S3 copy: `copyS3FileRange` copies only `[offset, offset + size)` of a source object with `UploadPartCopy`, and falls back to buffers when the source object is 5 MB or smaller or when multipart copy is not available (ceeb177, 5c28acb). Before it, #2415 needed its own path for CAS blobs, because a blob is `[header][payload]` and a whole-object copy would put the header into the backup. With the upstream ranged copy, a CAS blob can go through the common `BackupWriterS3::copyFileFromDisk` path. Only the offset, the source object size and the fallback reader change: the offset includes the blob header, and the reader reads the raw object, so both use object coordinates. `whole_object` is now computed from this offset, so a CAS blob never takes `CopyObject`. This lets us drop the extra code that #2415 added to upstream files: - remove `tryNativeCopyFromContentAddressedDisk` and the 5 MB check; `copyS3FileRange` routes small blobs and stores without multipart copy to buffers itself; - remove `DataSourceDescription::files_are_whole_objects` and `canUseNativeCopyWith`, and restore the upstream `sameKind` and `==` checks and data source description initializers; - guard the native copy with `isContentAddressed` instead: the S3 and Azure backup readers, the Azure backup writer and `DiskObjectStorage::copyFile`. A CAS file goes through buffers when it is stored in the manifest (empty key) or is not a blob. Add trace logs with the reason for both cases, and for a ranged copy that cannot be native in `copyS3File`. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Konstantin Morozov <[email protected]>
A blob that cannot be copied inside `S3` is now read from its object in the pool, only the payload range, by the fallback of `copyS3FileRange`, not through the `CAS` read path. Also say that only the endpoint has to match for the copy inside `S3` (the backup can be in another bucket), and that a `CAS` disk cannot be a backup destination. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Konstantin Morozov <[email protected]>
1216d8d to
a845af9
Compare
PR #2508 Audit Review
VerdictOne confirmed defect. A plain CAS disk copies only the blob payload. An encrypted disk in front of that CAS disk still takes whole-object Confirmed defectsHigh: Same-endpoint backup of an encrypted CAS disk stores the blob envelopeImpact: Anchor: Trigger: An Why defect: Fix direction (short): Unwrap Regression test direction (short): In Coverage summaryScope reviewed: the diff at Categories failed:
Categories passed:
Categories N/A:
Assumptions/limits: static only. The new integration test was not run. Encrypted-over-CAS is reachable: |
filimonov
left a comment
There was a problem hiding this comment.
- DiskEncrypted does not forward isContentAddressed(). With the capability field gone, that is the only thing that keeps an encrypted disk over CAS out of the native copy; today it is unreachable (INSERT is NOT_IMPLEMENTED), but one line next to
allowsPackedPartscloses it for good:
bool isContentAddressed() const override { return delegate->isContentAddressed(); }
- Optional but cheap:
chassert(!src_disk->isContentAddressed())at the start of the native branch inBackupWriterS3::copyFileFromDiskand the Azure writer, so a future wrapper that forgets the forward fails in sanitizer CI instead of writing a corrupt backup.
| ## What holds the data during a backup {#holding} | ||
|
|
||
| On a plain disk a backup pins files against deletion with a hard link. `CAS` uses a different | ||
| mechanism — pointer holding: | ||
|
|
||
| - the backup holds a `shared_ptr` to the table and to each part; | ||
| - the outdated-part cleanup skips those parts; | ||
| - while a part is alive so is its [ref](/antalya/cas/architecture/manifests-and-refs#ref-table) — the | ||
| name under which the part is registered in its namespace's ref table, and through which it points | ||
| at its manifest; | ||
| - while the ref is alive, garbage collection sees the manifest and its blobs as reachable. | ||
|
|
||
| This mechanism lives in the process's memory and **does not survive a server restart**. An | ||
| interrupted backup leaves nothing behind in the pool, but it also stops protecting the data once the | ||
| process is gone. For durable pinning there is `FREEZE`, which publishes a real ref. |
There was a problem hiding this comment.
shared_ptr etc - seems to be too low-level for user docs
… jobs The PR workflows deferred every functional-test job outside CORE_BLOCKING_JOB_NAMES behind those jobs, and the generated job condition skips a job when any upstream job failed. The CAS stateless lanes (cas storage / cas s3 storage, amd_binary and the sanitizer variants) therefore never ran on a pull request while an ASan integration shard was red, which has been every pull request since 2026-10-25: #2647, #2508 and this one all show them SKIPPED. The lanes need only their build artifact, so they now depend on the build, the docker images and the fast test only. Co-Authored-By: Claude Fable 5.1 <[email protected]> Signed-off-by: Mikhail Filimonov <[email protected]>
|
On a845af9 an encrypted disk over CAS accepts the insert, so the native-copy path is reachable. CREATE and INSERT into disk(type = encrypted, disk = disk(metadata_type = cas, ...)) both succeed on 26.8.34.20001. The insert returns exit code 0, with no autocommit error. The same statement on 26.6.8.20002 fails with Code: 48, NOT_IMPLEMENTED: "Autocommit writes are not supported for content part files on a content-addressed disk". BACKUP of that table to S3() on the same endpoint then calls copyS3File. CopyObject of the part files returns InvalidArgument, the multipart retry fails the same way, and the query ends with Code: 499. DiskEncrypted still does not report isContentAddressed(). |
This issue isn't caused by the PR. It's because inserts into CAS + encrypt started working, which is a scenario that wasn't supposed to work. It's related to dropping fake transactions. |
Forward `isContentAddressed` through `DiskEncrypted` so CAS detection works across encrypted wrappers. Assert that whole-object S3 backup copies do not use CAS sources, while keeping ranged CAS copies allowed. Describe part retention without `shared_ptr` in the user documentation. Related: #2508 Review: #2508 (review) Signed-off-by: Konstantin Morozov <[email protected]>
Related: #2415 and #2494 (includes / supersedes both)
Related: #2760
Related; #2773
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Fixed
BACKUPandMOVE PARTITION TO DISKfrom a CAS disk to an S3 destination on the pool's endpoint: the server-side copy failed on in-manifest files and copied blob headers. Also fixedBACKUP ... TO S3(...)from a read-only object-storage disk.Documentation entry for user-facing changes
...
CI/CD Options
Exclude tests:
Regression jobs to run: