-
Notifications
You must be signed in to change notification settings - Fork 695
Tpcc import imrovements (#17333) #19791
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🟢 |
⚪ Test history | Ya make output | Test bloat
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
⚪ Test history | Ya make output | Test bloat
⚪ Test history | Ya make output | Test bloat | Test bloat
⚪ Test history | Ya make output | Test bloat | Test bloat | Test bloat
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the TPCC import tool by tightening CLI option requirements, improving interrupt- and retry-handling in the loader, and adding sanity assertions to data-splitting unit tests.
- Require
--warehouses
(and hide--log-level
) in thetpcc init
,import
, andrun
commands - Add global interrupt checks and more granular retry-logic in
ExecuteWithRetry
andTPCCLoader
- Strengthen unit tests with non-negative/assert‐positive split counts
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
ydb/public/lib/ydb_cli/commands/ydb_workload_tpcc.cpp | Made Config overrides non-virtual, required warehouse arg |
ydb/library/workload/tpcc/ut/data_splitter_ut.cpp | Added UNIT_ASSERT checks for non-negative split counts |
ydb/library/workload/tpcc/import.cpp | Switched to global interrupt source; refined retry logging |
Comments suppressed due to low confidence (1)
ydb/public/lib/ydb_cli/commands/ydb_workload_tpcc.cpp:112
- The
tpcc import
andtpcc run
commands now require--warehouses
, but onlytpcc init
has a hidden--log-level
option. For consistency, consider adding the--log-level
flag to theimport
andrun
command configurations as well.
'w', "warehouses", TStringBuilder() << "Number of warehouses")
@@ -73,6 +74,7 @@ Y_UNIT_TEST_SUITE(TDataSplitterTest) { | |||
int stockWarehousesPerShard2 = (1000 + minShardCount - 1) / minShardCount; | |||
stockWarehousesPerShard = std::min(stockWarehousesPerShard, stockWarehousesPerShard2); | |||
int expectedStockSplits = (1000 - 1) / stockWarehousesPerShard; | |||
UNIT_ASSERT(expectedStockSplits > 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first assertion uses >= 0
but here you use > 0
, which is inconsistent and may fail if zero splits are valid. Consider standardizing on one boundary check (e.g. >= 0
) or adding a comment explaining why zero is invalid.
UNIT_ASSERT(expectedStockSplits > 0); | |
UNIT_ASSERT(expectedStockSplits >= 0); // Ensure consistency with earlier assertions |
Copilot uses AI. Check for mistakes.
@@ -511,15 +511,28 @@ NTable::TBulkUpsertResult LoadOrderLines( | |||
template<typename LoadFunc> | |||
void ExecuteWithRetry(const TString& operationName, LoadFunc loadFunc, TLog* Log) { | |||
for (int retryCount = 0; retryCount < MAX_RETRIES; ++retryCount) { | |||
if (GetGlobalInterruptSource().stop_requested()) { | |||
break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Breaking out of the retry loop on interrupt will naturally exit the function, but using return;
instead of break;
makes the intent explicit and avoids confusion about control flow.
break; | |
return; |
Copilot uses AI. Check for mistakes.
Changelog entry
...
Changelog category
Description for reviewers
...