aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkungasc <kungasc@yandex-team.com>2023-09-06 12:02:09 +0300
committerkungasc <kungasc@yandex-team.com>2023-09-06 12:45:28 +0300
commit3915747b32c1b4e9362a0d28697c10828a59e8f5 (patch)
tree40644337247cc8d17b74dea762cbb2464b98ed70
parent23225dd61414039ed8f923ca08c96efecc8894eb (diff)
downloadydb-3915747b32c1b4e9362a0d28697c10828a59e8f5.tar.gz
KIKIMR-18845 Fix TShardedCompaction.SplitSingleKey test with enabled CutIndexKeys option
-rw-r--r--ydb/core/tablet_flat/flat_part_charge.h19
1 files changed, 7 insertions, 12 deletions
diff --git a/ydb/core/tablet_flat/flat_part_charge.h b/ydb/core/tablet_flat/flat_part_charge.h
index 05b42219300..a0854e7499d 100644
--- a/ydb/core/tablet_flat/flat_part_charge.h
+++ b/ydb/core/tablet_flat/flat_part_charge.h
@@ -180,26 +180,21 @@ namespace NTable {
bool ready = true;
- const auto cmp = NPage::TCompare<NPage::TIndex::TRecord>(Scheme.Groups[0].ColsKeyIdx, keyDefaults);
-
// The first page that may contain splitKey
auto found = Index.LookupKey(splitKey, Scheme.Groups[0], ESeek::Lower, &keyDefaults);
- // Do we need to load the previous page (e.g. splitKey <= foundKey)
- bool needPrev = !found || !cmp(*found, splitKey);
+ // Note: as we may have cut index key we may both need prev and next pages
- if (needPrev) {
- if (auto prev = found; --prev) {
- TRowId pageBegin = prev->GetRowId();
- TRowId pageEnd = found ? found->GetRowId() : Index.GetEndRowId();
- if (pageBegin < endRowId && beginRowId < pageEnd) {
- ready &= bool(Env->TryGetPage(Part, prev->GetPageId()));
- }
+ if (auto prev = found; --prev) {
+ TRowId pageBegin = prev->GetRowId();
+ TRowId pageEnd = found ? found->GetRowId() : Index.GetEndRowId();
+ if (pageBegin < endRowId && beginRowId < pageEnd) {
+ ready &= bool(Env->TryGetPage(Part, prev->GetPageId()));
}
}
if (found && found->GetRowId() < endRowId) {
- bool needNext = !needPrev;
+ bool needNext = true;
if (found->GetRowId() < beginRowId) {
// iterator may re-seek to the first page that's in range
auto adjusted = Index.LookupRow(beginRowId, found);