Skip to content

[Fastshard] Recreate the journalled device when it is formatted - #7616

Open
arigachnyy wants to merge 3 commits into
mainfrom
users/arigachnyy/recreate-formatted-device
Open

arigachnyy wants to merge 3 commits into
mainfrom
users/arigachnyy/recreate-formatted-device

Conversation

@arigachnyy

@arigachnyy arigachnyy commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Notes

FormatDevice now stops the journalled device, wipes the region and
creates the device anew through the factory, so the device serves the
freshly formatted region.

A device that is not started, failed to start or failed to be recreated
has no journalled device behind it, and every request to it is rejected
with E_INVALID_STATE until the next format succeeds.

The handler's Stop runs in the executor alongside the formats: it waits
for the formats in flight, so the devices they start are stopped too,
and rejects any format that comes afterwards.

Issue

#6956

@github-actions

github-actions Bot commented Oct 24, 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/,cloud/fastshard/ (test time: 271s): all tests PASSED for commit aa23f0b.

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

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

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

🔴 linux-x86_64-relwithdebinfo target: cloud/blockstore/ (test time: 1646s): some tests FAILED for commit aa23f0b.

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
7682 7679 0 2 0 1 0

🔴 linux-x86_64-relwithdebinfo target: cloud/blockstore/ (test time: 26s): some tests FAILED for commit aa23f0b.

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
4 2 0 2 0 0 0

🔴 linux-x86_64-relwithdebinfo target: cloud/blockstore/ (test time: 14s): some tests FAILED for commit aa23f0b.

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
4 2 0 2 0 0 0

🔴 linux-x86_64-relwithdebinfo target: cloud/filestore/ (test time: 5460s) Test run completed, no test results found for commit aa23f0b.
Please check build logs.

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

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
5068 5067 0 0 0 1 0

@arigachnyy
arigachnyy force-pushed the users/arigachnyy/recreate-formatted-device branch from aa23f0b to a3b28d9 Compare October 24, 2026 20:43
@github-actions

github-actions Bot commented Oct 24, 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/,cloud/fastshard/ (test time: 267s): all tests PASSED for commit a3b28d9.

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

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

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

🔴 linux-x86_64-relwithdebinfo target: cloud/blockstore/ (test time: 1590s): some tests FAILED for commit a3b28d9.

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
7682 7679 0 2 0 1 0

🔴 linux-x86_64-relwithdebinfo target: cloud/blockstore/ (test time: 27s): some tests FAILED for commit a3b28d9.

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
4 2 0 2 0 0 0

🔴 linux-x86_64-relwithdebinfo target: cloud/blockstore/ (test time: 14s): some tests FAILED for commit a3b28d9.

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
4 2 0 2 0 0 0

🔴 linux-x86_64-relwithdebinfo target: cloud/filestore/ (test time: 5460s) Test run completed, no test results found for commit a3b28d9.
Please check build logs.

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

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
5068 5067 0 0 0 1 0

@arigachnyy
arigachnyy force-pushed the users/arigachnyy/recreate-formatted-device branch from a3b28d9 to a2c55b6 Compare October 25, 2026 12:25
@github-actions

github-actions Bot commented Oct 25, 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.

  • ⚫ tasks + storage + fastshard (job skipped)
  • ⚫ blockstore (job skipped)
  • ⚫ disk + manager (job skipped)
  • ⚫ filestore (job skipped)

FormatDevice now stops the journalled device, wipes the region and
creates the device anew through the factory, so the device serves the
freshly formatted region.

A device that is not started, failed to start or failed to be recreated
has no journalled device behind it, and every request to it is rejected
with E_INVALID_STATE until the next format succeeds.

The handler's Stop runs in the executor alongside the formats: it waits
for the formats in flight, so the devices they start are stopped too,
and rejects any format that comes afterwards.
@arigachnyy
arigachnyy force-pushed the users/arigachnyy/recreate-formatted-device branch from a2c55b6 to 78ca67e Compare October 25, 2026 12:28
@github-actions

github-actions Bot commented Oct 25, 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/,cloud/fastshard/ (test time: 271s): all tests PASSED for commit 78ca67e.

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

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

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

🔴 linux-x86_64-relwithdebinfo target: cloud/blockstore/ (test time: 1544s): some tests FAILED for commit 78ca67e.

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
7682 7679 0 2 0 1 0

🔴 linux-x86_64-relwithdebinfo target: cloud/blockstore/ (test time: 26s): some tests FAILED for commit 78ca67e.

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
4 2 0 2 0 0 0

🔴 linux-x86_64-relwithdebinfo target: cloud/blockstore/ (test time: 14s): some tests FAILED for commit 78ca67e.

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
4 2 0 2 0 0 0

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

TESTS PASSED ERRORS FAILED FAILED BUILD SKIPPED MUTED?
5068 5067 0 0 0 1 0

@github-actions

github-actions Bot commented Oct 26, 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/fastshard/ (test time: 16s): all tests PASSED for commit 4057ccb.

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

return TErrorResponse(
E_FAIL,
"TJournalledDeviceHandler is destroyed");
if constexpr (std::is_void_v<T>) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks strange

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

// completes
//

if (spec->Recreating.Initialized() && !spec->Recreating.HasValue()) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

needing to keep in mind that a future can be uninitialized makes the code more fragile

// and we'll also have a race as soon as we decide to add more executors

since Recreating is used only to sync with DoStop(), probably we can just use an integer which would track the number of inflight format ops and can check whether that integer is 0

and can add an event for waiting (in DoStop()) and signalling (from DoFormatDevice() - whenever a format completes)

@arigachnyy arigachnyy Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

// and we'll also have a race as soon as we decide to add more executors

Yes and this isn't the only problem we'll need to fix if we decide to add more executors. It might require some minor refactoring. I'll think about it when I add executors.

@github-actions

github-actions Bot commented Oct 26, 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/fastshard/ (test time: 16s): all tests PASSED for commit 2050367.

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

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.

2 participants