issue-3781: TFileRingBuffer - operations should return verbose errors - #6866
issue-3781: TFileRingBuffer - operations should return verbose errors#6866e673 wants to merge 5 commits into
Conversation
|
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/disk_manager/ (test time: 268s): all tests PASSED for commit 4ceee30.
🔴 linux-x86_64-relwithdebinfo target: cloud/blockstore/ (test time: 1573s): some tests FAILED for commit 4ceee30.
🔴 linux-x86_64-relwithdebinfo target: cloud/blockstore/ (test time: 918s): some tests FAILED for commit 4ceee30.
🔴 linux-x86_64-relwithdebinfo target: cloud/blockstore/ (test time: 1032s): some tests FAILED for commit 4ceee30.
🔴 linux-x86_64-relwithdebinfo target: cloud/filestore/ (test time: 4770s): some tests FAILED for commit 4ceee30.
🔴 linux-x86_64-relwithdebinfo target: cloud/filestore/ (test time: 4273s): some tests FAILED for commit 4ceee30.
🔴 linux-x86_64-relwithdebinfo target: cloud/filestore/ (test time: 4393s): some tests FAILED for commit 4ceee30.
|
|
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.
|
2d75ca5 to
f5419ac
Compare
|
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: 267s): all tests PASSED for commit f5419ac.
🟢 linux-x86_64-relwithdebinfo target: cloud/disk_manager/ (test time: 273s): all tests PASSED for commit f5419ac.
🔴 linux-x86_64-relwithdebinfo target: cloud/blockstore/ (test time: 1451s): some tests FAILED for commit f5419ac.
🟢 linux-x86_64-relwithdebinfo target: cloud/blockstore/ (test time: 917s): all tests PASSED for commit f5419ac.
🟢 linux-x86_64-relwithdebinfo target: cloud/filestore/ (test time: 4863s): all tests PASSED for commit f5419ac.
|
f5419ac to
92414f2
Compare
|
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.
|
|
AI review: I pulled the PR (2 commits, 6 files: Bugs / contract violations1. auto eh = Data()->ReadEntryHeader(it->second);
eh.Tag = tag;
Data()->WriteEntryHeader(it->second, eh); // returns false if Tag > MaxTag — ignored
return {};
2. Corruption detected mid-operation is still returned as success. This is the exact scenario the PR exists for:
3. A failed
4. The error-code taxonomy undercuts the PR's goal. Corruption maps to
Call sites still drop the new errors5.
6.
7.
Thread-safety commit8. The docs overpromise. "All further operations on the buffer will fail once the flag is set" isn't guaranteed cross-thread:
Tests
NitsThe variable
On CI: the latest run for f5419ac showed tasks+storage and disk_manager green with blockstore and filestore still in progress at the last bot update, and the previous revision had an actual build failure in tasks+storage plus one failed-build entry in the blockstore and filestore suites — so I'd wait for the remaining two suites before merging. The most impactful fixes: check |
|
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: 265s): all tests PASSED for commit 7fa4981.
🟢 linux-x86_64-relwithdebinfo target: cloud/disk_manager/ (test time: 289s): all tests PASSED for commit 7fa4981.
🔴 linux-x86_64-relwithdebinfo target: cloud/blockstore/ (test time: 1443s): some tests FAILED for commit 7fa4981.
🟢 linux-x86_64-relwithdebinfo target: cloud/blockstore/ (test time: 49s): all tests PASSED for commit 7fa4981.
🟢 linux-x86_64-relwithdebinfo target: cloud/filestore/ (test time: 4803s): all tests PASSED for commit 7fa4981.
|
| Y_ENSURE( | ||
| !HasError(res), | ||
| "Failed to commit allocation: " << FormatError(res)); |
There was a problem hiding this comment.
Can we get rid of exceptions usage?
There was a problem hiding this comment.
Yes, But this is unrelated to this PR and will be done in the next one
https://github.com/ydb-platform/nbs/pull/6867/changes#diff-4fd6698976acda0e55fdcf9397499b66e0c11ccd7e4517758b7d2296129c5ff6R102
| b.Execute( | ||
| [](TFileRingBuffer& rb) { UNIT_ASSERT(rb.PushBack("ABC")); }, | ||
| [](TFileRingBuffer& rb) | ||
| { UNIT_ASSERT_VALUES_EQUAL(true, rb.PushBack("ABC")); }, |
There was a problem hiding this comment.
rb.PushBack returns TResultOrError<bool>.
operator == (bool value, TResultOrError<bool>) checks that there is no error and the result equals to the value.
Notes
Current API of
TFileRingBuffermakes it impossible to figure out if a method was completed with success or failed, and if failed — if it was caused by a corruption or an invalid argument.This PR proposes the following changes in API:
bool->TResultOrError<bool>bool->TErrorbool->TErrorui32->TResultOrError<ui32>void->TErrorTStringBuf->TResultOrError<TStringBuf>void->TResultOrError<bool>void->TErrorTStringBufer->TResultOrError<TStringBuf>bool->TResultOrError<bool>General rule: an error is returned in the case of corruption or invalid argument.
This is needed for
WriteBackCacheandHandleOpsQueueso they can handle the situation when a corruption happens in the middle of processing.Additional changes:
Issue
#3781