diff --git a/docs/engineering/VALIDATION.md b/docs/engineering/VALIDATION.md index 906fb41..500e411 100644 --- a/docs/engineering/VALIDATION.md +++ b/docs/engineering/VALIDATION.md @@ -6913,3 +6913,10 @@ access at `src/persistence/cellular_checkpoint_store.cpp:550`: the stored action block inside the successful database result. Recovery now validates that the block is present and decodes a `value_or` copy. The PostgreSQL job failed on this diagnostic, so this run also did not start server-image or Harbor publication. + +CI run #290 confirmed both action-record repairs and found a third nested optional +access in the cellular profile-migration recovery check at +`src/persistence/cellular_checkpoint_store.cpp:464`. Recovery now copies the +optional migration record through `value_or` and validates the copy after +preserving the missing-record history failure. PostgreSQL failed on this +diagnostic, so the image and Harbor jobs remained blocked. diff --git a/src/persistence/cellular_checkpoint_store.cpp b/src/persistence/cellular_checkpoint_store.cpp index 152a894..1965bee 100644 --- a/src/persistence/cellular_checkpoint_store.cpp +++ b/src/persistence/cellular_checkpoint_store.cpp @@ -428,11 +428,12 @@ recover_cellular_checkpoint(Postgres& db, const FilesystemObjectStore& objects, auto migration = load_cellular_profile_migration(db, key, lease, manifest->commit, timeout); if (!migration) return std::unexpected{RecoveryFailure{RecoveryError::store, migration.error()}}; - if (!*migration || (*migration)->target_sequence != manifest->sequence || - (*migration)->target_commit != manifest->commit || - (*migration)->target_manifest_sha256 != *digest || - (*migration)->target_payload_sha256 != manifest->payload_sha256 || - (*migration)->target_sequence == 0) + const auto migration_record = migration->value_or(CellularProfileMigrationRecord{}); + if (!*migration || migration_record.target_sequence != manifest->sequence || + migration_record.target_commit != manifest->commit || + migration_record.target_manifest_sha256 != *digest || + migration_record.target_payload_sha256 != manifest->payload_sha256 || + migration_record.target_sequence == 0) return fail_with(RecoveryError::history); auto predecessor = load_region_commit(db, key, manifest->sequence - 1, timeout); if (!predecessor) @@ -453,15 +454,15 @@ recover_cellular_checkpoint(Postgres& db, const FilesystemObjectStore& objects, ((source_manifest->cellular_versions == cellular_v1_versions) != (manifest->cellular_versions == cellular_v2_versions)) || source_manifest->end_tick != manifest->end_tick || - (*migration)->source_sequence != source_manifest->sequence || - (*migration)->source_commit != source_manifest->commit || - (*migration)->source_manifest_sha256 != *source_manifest_digest || - (*migration)->source_payload_sha256 != source_manifest->payload_sha256 || - (*migration)->source_versions.size() != 36 || - !std::ranges::equal((*migration)->source_versions, + migration_record.source_sequence != source_manifest->sequence || + migration_record.source_commit != source_manifest->commit || + migration_record.source_manifest_sha256 != *source_manifest_digest || + migration_record.source_payload_sha256 != source_manifest->payload_sha256 || + migration_record.source_versions.size() != 36 || + !std::ranges::equal(migration_record.source_versions, std::span{*source_manifest_bytes}.subspan(160, 36)) || - (*migration)->target_versions.size() != 36 || - !std::ranges::equal((*migration)->target_versions, + migration_record.target_versions.size() != 36 || + !std::ranges::equal(migration_record.target_versions, std::span{*target_manifest_bytes}.subspan(160, 36))) return fail_with(RecoveryError::history); auto source_bytes =