Skip to content

Commit b72dccf

Browse files
committed
simplify
1 parent e52dd86 commit b72dccf

File tree

3 files changed

+45
-100
lines changed

3 files changed

+45
-100
lines changed

ydb/core/tx/schemeshard/schemeshard_schema.h

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2058,39 +2058,6 @@ struct Schema : NIceDb::Schema {
20582058
>;
20592059
};
20602060

2061-
// Detail table for each target table within an incremental restore operation
2062-
struct IncrementalRestoreTargets : Table<121> {
2063-
struct OperationId : Column<1, NScheme::NTypeIds::Uint64> { using Type = TTxId; }; // Foreign key to IncrementalRestoreOperations::Id
2064-
struct TargetIndex : Column<2, NScheme::NTypeIds::Uint32> {}; // To order/identify targets within an operation
2065-
2066-
struct TargetOwnerId : Column<3, NScheme::NTypeIds::Uint64> { using Type = TOwnerId; };
2067-
struct TargetLocalId : Column<4, NScheme::NTypeIds::Uint64> { using Type = TLocalPathId; };
2068-
struct TargetPathName : Column<5, NScheme::NTypeIds::Utf8> {}; // Full path string of the target table
2069-
2070-
struct State : Column<6, NScheme::NTypeIds::Byte> {};
2071-
struct Issue : Column<7, NScheme::NTypeIds::Utf8> {};
2072-
2073-
// Shows amount of incremental tables processed + 1 (0 means we still in a process of consistent copy tables)
2074-
struct ProgressTables : Column<8, NScheme::NTypeIds::Uint64> {};
2075-
2076-
struct StartTime : Column<9, NScheme::NTypeIds::Timestamp> {};
2077-
struct EndTime : Column<10, NScheme::NTypeIds::Timestamp> {};
2078-
2079-
using TKey = TableKey<OperationId, TargetIndex>;
2080-
using TColumns = TableColumns<
2081-
OperationId,
2082-
TargetIndex,
2083-
TargetOwnerId,
2084-
TargetLocalId,
2085-
TargetPathName,
2086-
State,
2087-
Issue,
2088-
ProgressTables,
2089-
StartTime,
2090-
EndTime
2091-
>;
2092-
};
2093-
20942061
using TTables = SchemaTables<
20952062
Paths,
20962063
TxInFlight,
@@ -2209,8 +2176,7 @@ struct Schema : NIceDb::Schema {
22092176
TenantDataErasureGenerations,
22102177
WaitingDataErasureShards,
22112178
SysView,
2212-
IncrementalRestoreOperations,
2213-
IncrementalRestoreTargets
2179+
IncrementalRestoreOperations
22142180
>;
22152181

22162182
static constexpr ui64 SysParam_NextPathId = 1;

ydb/core/tx/schemeshard/ut_incremental_restore/ut_incremental_restore.cpp

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -563,71 +563,6 @@ Y_UNIT_TEST_SUITE(TIncrementalRestoreTests) {
563563
UNIT_ASSERT_C(true, "Successfully queried IncrementalRestoreOperations table (no operations found)");
564564
}
565565

566-
// Also query the IncrementalRestoreTargets table to check for target information
567-
status = LocalMiniKQL(runtime, schemeShardTabletId.GetValue(), Sprintf(R"(
568-
(
569-
(let range '('('OperationId (Null) (Void)) '('TargetIndex (Null) (Void))))
570-
(let select '('OperationId 'TargetIndex 'TargetPathName 'State))
571-
(let targets (SelectRange 'IncrementalRestoreTargets range select '()))
572-
(let ret (AsList (SetResult 'Targets targets)))
573-
(return ret)
574-
)
575-
)"), result, err);
576-
577-
UNIT_ASSERT_VALUES_EQUAL_C(status, NKikimrProto::EReplyStatus::OK, err);
578-
579-
// Parse the targets result using NClient::TValue pattern
580-
auto targetsValue = NClient::TValue::Create(result);
581-
582-
// Verify that we can access the Targets result set
583-
auto targetsResultSet = targetsValue["Targets"];
584-
UNIT_ASSERT_C(targetsResultSet.HaveValue(), "Targets result set should be present");
585-
586-
auto targetsList = targetsResultSet["List"];
587-
if (targetsList.HaveValue()) {
588-
ui32 targetsCount = targetsList.Size();
589-
590-
// Log the number of targets found
591-
Cerr << "Found " << targetsCount << " incremental restore targets in database" << Endl;
592-
593-
// If we have targets, unpack and verify their structure
594-
for (ui32 i = 0; i < targetsCount; ++i) {
595-
auto target = targetsList[i];
596-
597-
// Verify that each target has the expected fields and extract values
598-
auto operationIdValue = target["OperationId"];
599-
auto targetIndexValue = target["TargetIndex"];
600-
auto targetPathNameValue = target["TargetPathName"];
601-
auto stateValue = target["State"];
602-
603-
UNIT_ASSERT_C(operationIdValue.HaveValue(), "Target should have OperationId field");
604-
UNIT_ASSERT_C(targetIndexValue.HaveValue(), "Target should have TargetIndex field");
605-
UNIT_ASSERT_C(targetPathNameValue.HaveValue(), "Target should have TargetPathName field");
606-
UNIT_ASSERT_C(stateValue.HaveValue(), "Target should have State field");
607-
608-
// Extract the field values using cast operators
609-
auto operationId = (ui64)operationIdValue;
610-
auto targetIndex = (ui32)targetIndexValue;
611-
auto targetPathName = (TString)targetPathNameValue;
612-
auto state = (ui32)stateValue;
613-
614-
Cerr << "Target " << i << ": OperationId=" << operationId
615-
<< ", TargetIndex=" << targetIndex
616-
<< ", TargetPathName=" << targetPathName
617-
<< ", State=" << state << Endl;
618-
619-
// Verify that the values make sense
620-
UNIT_ASSERT_C(operationId > 0, "Target OperationId should be positive");
621-
UNIT_ASSERT_C(!targetPathName.empty(), "Target path name should not be empty");
622-
}
623-
624-
UNIT_ASSERT_C(true, "Successfully queried and parsed IncrementalRestoreTargets table");
625-
} else {
626-
// No targets found, which is also valid for this test
627-
Cerr << "No targets found in IncrementalRestoreTargets table" << Endl;
628-
UNIT_ASSERT_C(true, "Successfully queried IncrementalRestoreTargets table (no targets found)");
629-
}
630-
631566
// Now verify that path states are correctly set for incremental restore operations
632567
Cerr << "Verifying path states during incremental restore..." << Endl;
633568

ydb/tests/functional/scheme_tests/canondata/tablet_scheme_tests.TestTabletSchemes.test_tablet_schemes_flat_schemeshard_/flat_schemeshard.schema

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8525,5 +8525,49 @@
85258525
]
85268526
}
85278527
}
8528+
},
8529+
{
8530+
"TableId": 120,
8531+
"TableName": "IncrementalRestoreOperations",
8532+
"TableKey": [
8533+
1
8534+
],
8535+
"ColumnsAdded": [
8536+
{
8537+
"ColumnId": 1,
8538+
"ColumnName": "Id",
8539+
"ColumnType": "Uint64"
8540+
},
8541+
{
8542+
"ColumnId": 2,
8543+
"ColumnName": "Operation",
8544+
"ColumnType": "String"
8545+
}
8546+
],
8547+
"ColumnsDropped": [],
8548+
"ColumnFamilies": {
8549+
"0": {
8550+
"Columns": [
8551+
1,
8552+
2
8553+
],
8554+
"RoomID": 0,
8555+
"Codec": 0,
8556+
"InMemory": false,
8557+
"Cache": 0,
8558+
"Small": 4294967295,
8559+
"Large": 4294967295
8560+
}
8561+
},
8562+
"Rooms": {
8563+
"0": {
8564+
"Main": 1,
8565+
"Outer": 1,
8566+
"Blobs": 1,
8567+
"ExternalBlobs": [
8568+
1
8569+
]
8570+
}
8571+
}
85288572
}
85298573
]

0 commit comments

Comments
 (0)