Skip to content

Host statistics skeleton#37946

Merged
drbasic merged 1 commit intoydb-platform:mainfrom
drbasic:host-stat
Apr 13, 2026
Merged

Host statistics skeleton#37946
drbasic merged 1 commit intoydb-platform:mainfrom
drbasic:host-stat

Conversation

@drbasic
Copy link
Copy Markdown
Contributor

@drbasic drbasic commented Apr 11, 2026

Changelog entry

...

Changelog category

  • Not for changelog (changelog entry is not required)

Description for reviewers

...

@drbasic drbasic requested a review from a team as a code owner April 11, 2026 06:34
@ydbot
Copy link
Copy Markdown
Collaborator

ydbot commented Apr 11, 2026

Run Extra Tests

Run additional tests for this PR. You can customize:

  • Test Size: small, medium, large (default: all)
  • Test Targets: any directory path (default: ydb/)
  • Sanitizers: ASAN, MSAN, TSAN
  • Coredumps: enable for debugging (default: off)
  • Additional args: custom ya make arguments

▶  Run tests

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 11, 2026

2026-04-11 06:38:51 UTC Pre-commit check linux-x86_64-relwithdebinfo for 5163578 has started.
2026-04-11 06:39:09 UTC Artifacts will be uploaded here
2026-04-11 06:41:32 UTC ya make is running...
🟡 2026-04-11 09:04:00 UTC Some tests failed, follow the links below. Going to retry failed tests...

Details

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
49369 45815 0 4 3537 13

2026-04-11 09:04:17 UTC ya make is running... (failed tests rerun, try 2)
🟢 2026-04-11 09:05:43 UTC Tests successful.

Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
22 (only retried tests) 22 0 0 0 0

🟢 2026-04-11 09:05:46 UTC Build successful.
🟢 2026-04-11 09:06:03 UTC ydbd size 2.5 GiB changed* by +27.2 KiB, which is < 100.0 KiB vs main: OK

ydbd size dash main: bc2335e merge: 5163578 diff diff %
ydbd size 2 662 299 016 Bytes 2 662 326 896 Bytes +27.2 KiB +0.001%
ydbd stripped size 568 318 904 Bytes 568 329 144 Bytes +10.0 KiB +0.002%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 11, 2026

2026-04-11 06:38:57 UTC Pre-commit check linux-x86_64-release-asan for 5163578 has started.
2026-04-11 06:39:14 UTC Artifacts will be uploaded here
2026-04-11 06:41:32 UTC ya make is running...
🟡 2026-04-11 08:25:14 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
18773 18713 0 22 34 4

🟢 2026-04-11 08:25:22 UTC Build successful.
🟢 2026-04-11 08:25:49 UTC ydbd size 4.1 GiB changed* by +45.6 KiB, which is < 100.0 KiB vs main: OK

ydbd size dash main: bc2335e merge: 5163578 diff diff %
ydbd size 4 353 844 912 Bytes 4 353 891 600 Bytes +45.6 KiB +0.001%
ydbd stripped size 1 635 630 352 Bytes 1 635 651 536 Bytes +20.7 KiB +0.001%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@vazhem vazhem requested a review from Copilot April 13, 2026 10:59
@drbasic drbasic enabled auto-merge (squash) April 13, 2026 10:59
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Introduces an initial (“skeleton”) host statistics model for partition_direct, and wires it into TDirectBlockGroup to record per-host success/error events and execution time for key operations.

Changes:

  • Added new partition_direct/model library with THostStat (+ unit test) to track error streak duration/count.
  • Instrumented TDirectBlockGroup async operation completions to call host-stat hooks (OnResponse / OnMultiFlushResponse) with measured execution time.
  • Renamed HostIdHostIndex in multi-PBuffer write responses and adjusted consumers; removed an unnecessary constructor body in TFastPathService.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
ydb/core/nbs/cloud/blockstore/libs/storage/partition_direct/ya.make Adds the new model submodule to build and links it into partition_direct.
ydb/core/nbs/cloud/blockstore/libs/storage/partition_direct/write_request.cpp Consumes renamed HostIndex field when mapping multi-write results back to locations.
ydb/core/nbs/cloud/blockstore/libs/storage/partition_direct/model/ya.make New library target for the host-stat model implementation.
ydb/core/nbs/cloud/blockstore/libs/storage/partition_direct/model/ut/ya.make New unit test target wiring for the host-stat model.
ydb/core/nbs/cloud/blockstore/libs/storage/partition_direct/model/host_stat.h Declares EOperation and THostStat API.
ydb/core/nbs/cloud/blockstore/libs/storage/partition_direct/model/host_stat.cpp Implements basic error tracking/reset behavior for THostStat.
ydb/core/nbs/cloud/blockstore/libs/storage/partition_direct/model/host_stat_ut.cpp Unit tests for error duration/count behavior.
ydb/core/nbs/cloud/blockstore/libs/storage/partition_direct/fast_path_service.cpp Removes now-unneeded ctor body / Y_UNUSED call.
ydb/core/nbs/cloud/blockstore/libs/storage/partition_direct/direct_block_group.h Adds host-stat member storage and helper methods; updates response struct field name.
ydb/core/nbs/cloud/blockstore/libs/storage/partition_direct/direct_block_group.cpp Records per-operation execution time and updates host stats on responses.
Comments suppressed due to low confidence (1)

ydb/core/nbs/cloud/blockstore/libs/storage/partition_direct/direct_block_group.cpp:514

  • In WriteBlocksToManyPBuffers, disksIds is constructed with hostIndexes.size() (pre-sized) and then the loop appends with push_back(). This results in a vector that is larger than intended and contains leading default-initialized TDDiskId entries, so WriteToManyPBuffers may receive unexpected/invalid destination IDs. Prefer Reserve(hostIndexes.size()) (or default-construct empty) and push_back, or fill by index without push_back.
    TVector<NKikimrBlobStorage::NDDisk::TDDiskId> disksIds(hostIndexes.size());
    for (auto hostIndex: hostIndexes) {
        const auto& ddiskId =
            PBufferConnections[hostIndex].HostConnection.DDiskId;


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@drbasic drbasic merged commit d5690f8 into ydb-platform:main Apr 13, 2026
15 checks passed
@ydbot
Copy link
Copy Markdown
Collaborator

ydbot commented Apr 13, 2026

Backport

To backport this PR, click the button next to the target branch and then click "Run workflow" in the Run Actions UI.

Branch Run
stable-25-4, stable-25-4-1, stable-26-1, stable-26-1-1 ▶  Backport
stable-26-1, stable-26-1-1 ▶  Backport
stable-26-1 ▶  Backport

▶  Backport manual

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants