Skip to content

[NBS] issue-6279: persist blob metas in local db#6559

Open
vladstepanyuk wants to merge 2 commits into
mainfrom
users/vladstepanyuk/issue-6279/persist-blob-metas-in-local-db/0
Open

[NBS] issue-6279: persist blob metas in local db#6559
vladstepanyuk wants to merge 2 commits into
mainfrom
users/vladstepanyuk/issue-6279/persist-blob-metas-in-local-db/0

Conversation

@vladstepanyuk

Copy link
Copy Markdown
Collaborator

Notes

Added persisting blob metas from cleanup queue in local db.

Issue

#6279

@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Note

This is an automated comment that will be appended during run.

Note

All workloads for linux-x86_64-relwithdebinfo have completed.

Tip

Planned checks for linux-x86_64-relwithdebinfo.

🟢 linux-x86_64-relwithdebinfo target: cloud/tasks/,cloud/storage/ (test time: 259s): all tests PASSED for commit f7c7b9a.

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
1215 1215 0 0 0 0 0

🟢 linux-x86_64-relwithdebinfo target: cloud/disk_manager/ (test time: 274s): all tests PASSED for commit f7c7b9a.

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
1572 1572 0 0 0 0 0

🟢 linux-x86_64-relwithdebinfo target: cloud/blockstore/ (test time: 1370s): all tests PASSED for commit f7c7b9a.

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
6848 6847 0 0 0 1 0

🟢 linux-x86_64-relwithdebinfo target: cloud/filestore/ (test time: 4972s): all tests PASSED for commit f7c7b9a.

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
4345 4345 0 0 0 0 0

@vladstepanyuk vladstepanyuk added large-tests Launch large tests for PR blockstore Add this label to run only cloud/blockstore build and tests on PR rebase Add this label if you want to rebase your PR for test run need_ai_review labels Jul 21, 2026
@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Note

This is an automated comment that will be appended during run.

Note

All workloads for linux-x86_64-relwithdebinfo have completed.

Tip

Planned checks for linux-x86_64-relwithdebinfo.

  • ✅ blockstore

@robot-vibe-db robot-vibe-db Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI Review Summary

Verdict: ✅ No critical issues found

Critical issues

No critical issues found.

Other findings

  • Minor | Medium: In-memory cleanup queue items in test setup lack AdditionalFields despite DB having them, diverging from the production load path — part_cleanup_logic_ut.cpp:162
  • Minor | Low: Empty AdditionalFields proto written to DB when neither BlobMeta nor RecreatedBlobMeta is available for an affected blob — part_actor_addblobs.cpp:614
  • Minor | Medium: No test for backward-compatible upgrade path (reading old cleanup queue rows without the AdditionalFields column) — part_database_ut.cpp:816
  • Nit | High: Unnecessary blank line after if guard — part_actor_addblobs.cpp:613

This review was generated automatically. Critical issues require attention; other findings are advisory.
If this comment was useful, please give it a 👍 — it helps us improve the review bot.

MakeCleanupQueueAdditionalFields(setup.MergedBlobMeta));
});

state.GetCleanupQueue().Add({setup.MixedBlobId, deletionCommitId, {}});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severity: Minor
Confidence: Medium

The in-memory queue is populated with empty {} AdditionalFields, while the DB (written in SetupMixedAndMergedBlobs) stores them with blob metas. In production, after partition restart, ReadCleanupQueue reads AdditionalFields from DB and populates the in-memory items with them via State->GetCleanupQueue().Add(args.CleanupQueue).

This setup intentionally tests the fallback path (no recreated blob meta), but the divergence from the production load path could confuse future readers. Consider adding a brief comment here explaining why AdditionalFields is intentionally left empty (e.g., "// Intentionally empty to test the fallback path without recreated blob meta").

if (IsBlockMaskFull(blockMask, MaxBlocksInBlob)) {
NProto::TBlobMeta blobMeta;

NProto::TCleanupQueueAdditionalFields additionalFields;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severity: Minor
Confidence: Low

When neither kv.second.BlobMeta nor kv.second.RecreatedBlobMeta is available, an empty TCleanupQueueAdditionalFields proto is constructed and written to the DB. This is functionally correct (the cleanup logic falls through to reading blob meta from DB), but it stores unnecessary empty data in the cleanup queue table.

Consider wrapping the DB write and in-memory add logic so that the AdditionalFields is only populated when there's actually meta to store, or accept the minor overhead as a design simplification.

additionalFields.SerializeAsString(),
items[0].AdditionalFields.SerializeAsString());
});
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severity: Minor
Confidence: Medium

This test verifies the write/read roundtrip with AdditionalFields, which is good. Consider adding a companion test that verifies backward compatibility with old-format cleanup queue rows. Specifically:

  1. Write a cleanup queue entry using the old format (without the AdditionalFields column, or with only key columns)
  2. Read it back and verify that AdditionalFields is default-constructed (empty)
  3. Verify that the cleanup logic handles this empty case correctly (falls through to DB read)

While GetValueOrDefault handles missing columns automatically, an explicit test would document and protect this upgrade path, especially since existing partitions will have old-format rows when this code is deployed.


if (IsBlockMaskFull(blockMask, MaxBlocksInBlob)) {
NProto::TBlobMeta blobMeta;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severity: Nit
Confidence: High

Unnecessary blank line after the if guard. The surrounding code style in this file doesn't use blank lines after if guards.

@robot-vibe-db

robot-vibe-db Bot commented Jul 21, 2026

Copy link
Copy Markdown

Full analysis log

Analysis performed by claude, claude-opus-4-6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai_reviewed blockstore Add this label to run only cloud/blockstore build and tests on PR large-tests Launch large tests for PR rebase Add this label if you want to rebase your PR for test run

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant