Skip to content

Commit 4d19cc6

Browse files
author
Vladislav Gogov
authored
Merge branch 'stable-24-3' into fix-11186
2 parents 51f444d + 56a2e8d commit 4d19cc6

File tree

171 files changed

+3307
-1702
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

171 files changed

+3307
-1702
lines changed

.github/config/muted_ya.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@ ydb/core/kqp/ut/tx KqpSnapshotRead.ReadOnlyTxWithIndexCommitsOnConcurrentWrite+w
1818
ydb/core/kqp/ut/tx KqpSinkTx.InvalidateOnError
1919
ydb/core/kqp/ut/query KqpLimits.QueryReplySize
2020
ydb/core/kqp/ut/query KqpQuery.QueryTimeout
21-
ydb/core/kqp/ut/service KqpQueryService.TableSink_OlapRWQueries
2221
ydb/core/kqp/ut/service KqpQueryService.TableSink_OltpReplace+HasSecondaryIndex
23-
ydb/core/kqp/ut/query KqpQuery.OlapCreateAsSelect_Complex
24-
ydb/core/kqp/ut/query KqpQuery.OlapCreateAsSelect_Simple
2522
ydb/core/kqp/ut/scan KqpRequestContext.TraceIdInErrorMessage
2623
ydb/core/kqp/ut/scheme KqpOlapScheme.TenThousandColumns
2724
ydb/core/kqp/ut/scheme KqpScheme.AlterAsyncReplication
@@ -32,10 +29,8 @@ ydb/core/kqp/ut/scheme [44/50]*
3229
ydb/core/kqp/ut/service KqpQueryService.ExecuteQueryPgTableSelect
3330
ydb/core/kqp/ut/service KqpQueryService.QueryOnClosedSession
3431
ydb/core/kqp/ut/service KqpQueryService.TableSink_OltpUpdate
35-
ydb/core/kqp/ut/service KqpQueryService.TableSink_Htap*
3632
ydb/core/kqp/ut/service KqpService.CloseSessionsWithLoad
3733
ydb/core/kqp/ut/service [38/50]*
38-
ydb/core/kqp/ut/service KqpQueryService.TableSink_OltpUpdate
3934
ydb/core/kqp/ut/service KqpQueryService.TableSink_OltpReplace+HasSecondaryIndex
4035
ydb/core/persqueue/ut [37/40] chunk chunk
4136
ydb/core/persqueue/ut [38/40] chunk chunk

ydb/core/base/ticket_parser.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,24 @@ namespace NKikimr {
154154

155155
struct TError {
156156
TString Message;
157+
TString LogMessage;
157158
bool Retryable = true;
158159

159160
bool empty() const {
160-
return Message.empty();
161+
return Message.empty() && LogMessage.empty();
162+
}
163+
164+
bool HasMessage() const {
165+
return !Message.empty();
166+
}
167+
168+
bool HasLogMessage() const {
169+
return !LogMessage.empty();
161170
}
162171

163172
void clear() {
164173
Message.clear();
174+
LogMessage.clear();
165175
Retryable = true;
166176
}
167177

ydb/core/cms/console/configs_dispatcher.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,13 @@ void TConfigsDispatcher::Bootstrap()
300300
CurrentConfig,
301301
0,
302302
true,
303-
1);
303+
1,
304+
{},
305+
{},
306+
TNodeInfo{
307+
.Tenant = Labels.contains("tenant") ? Labels.at("tenant") : TString(""),
308+
.NodeType = Labels.contains("node_type") ? Labels.at("node_type") : TString(""),
309+
});
304310
CommonSubscriptionClient = RegisterWithSameMailbox(commonClient);
305311

306312
Become(&TThis::StateInit);

ydb/core/cms/console/console_configs_subscriber.cpp

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ class TConfigsSubscriber : public TActorBootstrapped<TConfigsSubscriber> {
4848
bool processYaml,
4949
ui64 version,
5050
const TString &yamlConfig,
51-
const TMap<ui64, TString> &volatileYamlConfigs)
51+
const TMap<ui64, TString> &volatileYamlConfigs,
52+
const std::optional<TNodeInfo> explicitNodeInfo)
5253
: OwnerId(ownerId)
5354
, Cookie(cookie)
5455
, Kinds(kinds)
@@ -67,6 +68,15 @@ class TConfigsSubscriber : public TActorBootstrapped<TConfigsSubscriber> {
6768
VolatileYamlConfigHashes[id] = THash<TString>()(config);
6869
}
6970
}
71+
72+
if (explicitNodeInfo) {
73+
if (explicitNodeInfo->Tenant) {
74+
Tenant = explicitNodeInfo->Tenant;
75+
} else {
76+
Tenant = "<none>";
77+
}
78+
NodeType = explicitNodeInfo->NodeType;
79+
}
7080
}
7181

7282
static constexpr NKikimrServices::TActivity::EType ActorActivityType() {
@@ -82,7 +92,11 @@ class TConfigsSubscriber : public TActorBootstrapped<TConfigsSubscriber> {
8292
return;
8393
}
8494

85-
SendPoolStatusRequest(ctx);
95+
if (!Tenant) {
96+
SendPoolStatusRequest(ctx);
97+
} else {
98+
Subscribe(ctx);
99+
}
86100
Become(&TThis::StateWork);
87101
}
88102

@@ -417,9 +431,19 @@ IActor *CreateConfigsSubscriber(
417431
bool processYaml,
418432
ui64 version,
419433
const TString &yamlConfig,
420-
const TMap<ui64, TString> &volatileYamlConfigs)
434+
const TMap<ui64, TString> &volatileYamlConfigs,
435+
const std::optional<TNodeInfo> explicitNodeInfo)
421436
{
422-
return new TConfigsSubscriber(ownerId, cookie, kinds, currentConfig, processYaml, version, yamlConfig, volatileYamlConfigs);
437+
return new TConfigsSubscriber(
438+
ownerId,
439+
cookie,
440+
kinds,
441+
currentConfig,
442+
processYaml,
443+
version,
444+
yamlConfig,
445+
volatileYamlConfigs,
446+
explicitNodeInfo);
423447
}
424448

425449
} // namespace NKikimr::NConsole

ydb/core/cms/console/console_configs_subscriber.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,15 @@
66

77
#include <ydb/library/actors/core/actor.h>
88

9+
#include <optional>
10+
911
namespace NKikimr::NConsole {
1012

13+
struct TNodeInfo {
14+
TString Tenant;
15+
TString NodeType;
16+
};
17+
1118
IActor *CreateConfigsSubscriber(
1219
const TActorId &ownerId,
1320
const TVector<ui32> &kinds,
@@ -16,6 +23,7 @@ IActor *CreateConfigsSubscriber(
1623
bool processYaml = false,
1724
ui64 version = 0,
1825
const TString &yamlConfig = {},
19-
const TMap<ui64, TString> &volatileYamlConfigs = {});
26+
const TMap<ui64, TString> &volatileYamlConfigs = {},
27+
const std::optional<TNodeInfo> explicitNodeInfo = std::nullopt);
2028

2129
} // namespace NKikimr::NConsole

ydb/core/cms/console/log_settings_configurator_ut.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,11 @@ Y_UNIT_TEST_SUITE(TLogSettingsConfiguratorTests)
263263

264264
Y_UNIT_TEST(TestRemoveComponentEntries)
265265
{
266-
TTenantTestRuntime runtime(DefaultConsoleTestConfig());
266+
NKikimrConfig::TAppConfig ext;
267+
auto& label = *ext.AddLabels();
268+
label.SetName("tenant");
269+
label.SetValue(TENANT1_1_NAME);
270+
TTenantTestRuntime runtime(DefaultConsoleTestConfig(), ext);
267271
auto settings = InitLogSettingsConfigurator(runtime);
268272
WaitForUpdate(runtime); // initial update
269273

@@ -292,7 +296,11 @@ Y_UNIT_TEST_SUITE(TLogSettingsConfiguratorTests)
292296

293297
Y_UNIT_TEST(TestChangeDefaults)
294298
{
295-
TTenantTestRuntime runtime(DefaultConsoleTestConfig());
299+
NKikimrConfig::TAppConfig ext;
300+
auto& label = *ext.AddLabels();
301+
label.SetName("tenant");
302+
label.SetValue(TENANT1_1_NAME);
303+
TTenantTestRuntime runtime(DefaultConsoleTestConfig(), ext);
296304
auto settings = InitLogSettingsConfigurator(runtime);
297305
WaitForUpdate(runtime); // initial update
298306

ydb/core/formats/arrow/arrow_filter.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -575,8 +575,10 @@ TColumnFilter TColumnFilter::CombineSequentialAnd(const TColumnFilter& extFilter
575575
}
576576

577577
TColumnFilter::TIterator TColumnFilter::GetIterator(const bool reverse, const ui32 expectedSize) const {
578-
if ((IsTotalAllowFilter() || IsTotalDenyFilter()) && !Filter.size()) {
579-
return TIterator(reverse, expectedSize, LastValue);
578+
if (IsTotalAllowFilter()) {
579+
return TIterator(reverse, expectedSize, true);
580+
} else if (IsTotalDenyFilter()) {
581+
return TIterator(reverse, expectedSize, false);
580582
} else {
581583
AFL_VERIFY(expectedSize == Size())("expected", expectedSize)("size", Size())("reverse", reverse);
582584
return TIterator(reverse, Filter, GetStartValue(reverse));

ydb/core/formats/arrow/arrow_helpers.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,18 @@ bool IsSortedAndUnique(const std::shared_ptr<arrow::RecordBatch>& batch,
196196
}
197197
}
198198

199-
std::shared_ptr<arrow::RecordBatch> SortBatch(const std::shared_ptr<arrow::RecordBatch>& batch,
200-
const std::shared_ptr<arrow::Schema>& sortingKey, const bool andUnique) {
199+
std::shared_ptr<arrow::RecordBatch> SortBatch(
200+
const std::shared_ptr<arrow::RecordBatch>& batch, const std::vector<std::shared_ptr<arrow::Array>>& sortingKey, const bool andUnique) {
201+
auto sortPermutation = MakeSortPermutation(sortingKey, andUnique);
202+
if (sortPermutation) {
203+
return Reorder(batch, sortPermutation, andUnique);
204+
} else {
205+
return batch;
206+
}
207+
}
208+
209+
std::shared_ptr<arrow::RecordBatch> SortBatch(const std::shared_ptr<arrow::RecordBatch>& batch, const std::shared_ptr<arrow::Schema>& sortingKey,
210+
const bool andUnique) {
201211
auto sortPermutation = MakeSortPermutation(batch, sortingKey, andUnique);
202212
if (sortPermutation) {
203213
return Reorder(batch, sortPermutation, andUnique);

ydb/core/formats/arrow/arrow_helpers.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ TString SerializeBatchNoCompression(const std::shared_ptr<arrow::RecordBatch>& b
2626
std::shared_ptr<arrow::RecordBatch> DeserializeBatch(const TString& blob,
2727
const std::shared_ptr<arrow::Schema>& schema);
2828

29-
std::shared_ptr<arrow::RecordBatch> SortBatch(const std::shared_ptr<arrow::RecordBatch>& batch,
30-
const std::shared_ptr<arrow::Schema>& sortingKey, const bool andUnique);
29+
std::shared_ptr<arrow::RecordBatch> SortBatch(
30+
const std::shared_ptr<arrow::RecordBatch>& batch, const std::shared_ptr<arrow::Schema>& sortingKey, const bool andUnique);
31+
std::shared_ptr<arrow::RecordBatch> SortBatch(
32+
const std::shared_ptr<arrow::RecordBatch>& batch, const std::vector<std::shared_ptr<arrow::Array>>& sortingKey, const bool andUnique);
3133
bool IsSorted(const std::shared_ptr<arrow::RecordBatch>& batch,
3234
const std::shared_ptr<arrow::Schema>& sortingKey,
3335
bool desc = false);

ydb/core/formats/arrow/permutations.cpp

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,25 @@
1515

1616
namespace NKikimr::NArrow {
1717

18-
std::shared_ptr<arrow::UInt64Array> MakeSortPermutation(const std::shared_ptr<arrow::RecordBatch>& batch, const std::shared_ptr<arrow::Schema>& sortingKey, const bool andUnique) {
19-
auto keyBatch = TColumnOperator().VerifyIfAbsent().Adapt(batch, sortingKey).DetachResult();
20-
auto keyColumns = std::make_shared<TArrayVec>(keyBatch->columns());
18+
std::shared_ptr<arrow::UInt64Array> MakeSortPermutation(const std::vector<std::shared_ptr<arrow::Array>>& keyColumns, const bool andUnique) {
19+
std::optional<i64> count;
20+
for (auto&& i : keyColumns) {
21+
AFL_VERIFY(i);
22+
if (!count) {
23+
count = i->length();
24+
} else {
25+
AFL_VERIFY(*count == i->length());
26+
}
27+
}
28+
AFL_VERIFY(count);
2129
std::vector<TRawReplaceKey> points;
22-
points.reserve(keyBatch->num_rows());
23-
24-
for (int i = 0; i < keyBatch->num_rows(); ++i) {
25-
points.push_back(TRawReplaceKey(keyColumns.get(), i));
30+
points.reserve(*count);
31+
for (int i = 0; i < *count; ++i) {
32+
points.push_back(TRawReplaceKey(&keyColumns, i));
2633
}
2734

2835
bool haveNulls = false;
29-
for (auto& column : *keyColumns) {
36+
for (auto& column : keyColumns) {
3037
if (HasNulls(column)) {
3138
haveNulls = true;
3239
break;
@@ -36,11 +43,9 @@ std::shared_ptr<arrow::UInt64Array> MakeSortPermutation(const std::shared_ptr<ar
3643
if (haveNulls) {
3744
std::sort(points.begin(), points.end());
3845
} else {
39-
std::sort(points.begin(), points.end(),
40-
[](const TRawReplaceKey& a, const TRawReplaceKey& b) {
41-
return a.CompareNotNull(b) == std::partial_ordering::less;
42-
}
43-
);
46+
std::sort(points.begin(), points.end(), [](const TRawReplaceKey& a, const TRawReplaceKey& b) {
47+
return a.CompareNotNull(b) == std::partial_ordering::less;
48+
});
4449
}
4550

4651
arrow::UInt64Builder builder;
@@ -78,6 +83,12 @@ std::shared_ptr<arrow::UInt64Array> MakeSortPermutation(const std::shared_ptr<ar
7883
return out;
7984
}
8085

86+
std::shared_ptr<arrow::UInt64Array> MakeSortPermutation(const std::shared_ptr<arrow::RecordBatch>& batch,
87+
const std::shared_ptr<arrow::Schema>& sortingKey, const bool andUnique) {
88+
auto keyBatch = TColumnOperator().VerifyIfAbsent().Adapt(batch, sortingKey).DetachResult();
89+
return MakeSortPermutation(keyBatch->columns(), andUnique);
90+
}
91+
8192
namespace {
8293

8394
template <class TDataContainer>

0 commit comments

Comments
 (0)