Skip to content

Commit 388682a

Browse files
committed
Merge branch 'main' into splitMerge_rescue
2 parents a434d7b + 2ea3ab3 commit 388682a

File tree

87 files changed

+1626
-907
lines changed

Some content is hidden

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

87 files changed

+1626
-907
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
### Changelog entry <!-- a user-readable short description of changes introduced in this PR -->
2+
3+
...
4+
5+
### Changelog category <!-- remove all except one -->
6+
7+
* New feature
8+
* Experimental feature
9+
* Improvement
10+
* Performance improvement
11+
* Bugfix
12+
* Backward incompatible change
13+
* Documentation (changelog entry is not required)
14+
* Not for changelog (changelog entry is not required)
15+
16+
### Additional information
17+
18+
...

.github/config/muted_ya.txt

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
ydb/core/blobstorage/dsproxy/ut TBlobStorageProxySequenceTest.TestBlock42PutWithChangingSlowDisk
12
ydb/core/blobstorage/pdisk/ut TSectorMap.*
23
ydb/core/blobstorage/ut_blobstorage CostMetricsGetBlock4Plus2.TestGet4Plus2BlockRequests10000Inflight1BlobSize1000
34
ydb/core/blobstorage/ut_blobstorage Defragmentation.DoesItWork
@@ -6,30 +7,43 @@ ydb/core/blobstorage/ut_blobstorage VDiskAssimilation.Test
67
ydb/core/blobstorage/ut_blobstorage [6/10]*
78
ydb/core/blobstorage/ut_blobstorage/ut_read_only_vdisk ReadOnlyVDisk.TestStorageLoad
89
ydb/core/cms/ut_sentinel TSentinelTests.BSControllerCantChangeStatus
10+
ydb/core/persqueue/ut [31/40]*
911
ydb/core/persqueue/ut TPersQueueMirrorer.TestBasicRemote
12+
ydb/core/quoter/ut QuoterWithKesusTest.PrefetchCoefficient
1013
ydb/core/kqp/ut/federated_query/generic *
1114
ydb/core/kqp/ut/scan KqpRequestContext.TraceIdInErrorMessage
15+
ydb/core/kqp/ut/scheme KqpOlapScheme.TenThousandColumns
1216
ydb/core/kqp/ut/service KqpQueryService.ExecuteQueryPgTableSelect
1317
ydb/core/tx/columnshard/ut_schema TColumnShardTestSchema.ForgetAfterFail
1418
ydb/core/tx/columnshard/ut_schema TColumnShardTestSchema.RebootForgetAfterFail
19+
ydb/core/tx/columnshard/engines/ut *
1520
ydb/core/tx/coordinator/ut Coordinator.RestoreTenantConfiguration
21+
ydb/core/tx/schemeshard/ut_split_merge TSchemeShardSplitBySizeTest.Merge1KShards
1622
ydb/library/yql/providers/generic/connector/tests test.py.test_select_positive_postgresql*
1723
ydb/library/yql/sql/pg/ut PgSqlParsingAutoparam.AutoParamValues_DifferentTypes
24+
ydb/library/yql/tests/sql/dq_file/part16 test.py.test[expr-as_dict_list_key-default.txt-Analyze]
25+
ydb/library/yql/tests/sql/dq_file/part18 test.py.test[expr-cast_type_bind-default.txt-Analyze]
1826
ydb/public/sdk/cpp/client/ydb_topic/ut BasicUsage.WriteRead
1927
ydb/services/persqueue_v1/ut TPersQueueTest.DirectRead*
20-
ydb/services/ydb/sdk_sessions_pool_ut YdbSdkSessionsPool.StressTestSync10
28+
ydb/services/persqueue_v1/ut [3/10]*
29+
ydb/services/ydb/sdk_sessions_pool_ut YdbSdkSessionsPool.StressTestSync*
2130
ydb/services/ydb/table_split_ut YdbTableSplit.SplitByLoadWithReadsMultipleSplitsWithData
2231
ydb/services/ydb/ut YdbOlapStore.LogPagingAfter-NotNull
2332
ydb/tests/fq/s3 *
2433
ydb/tests/fq/yds test_metrics_cleanup.py.TestCleanup.test_cleanup[v1]
2534
ydb/tests/functional/audit *
35+
ydb/tests/functional/blobstorage test_replication.py.TestReplicationAfterNodesRestart.test_replication[mirror-3-dc]
2636
ydb/tests/functional/clickbench test.py.test_plans*
37+
ydb/tests/functional/clickbench test.py.test_run_determentistic[column]
2738
ydb/tests/functional/kqp/kqp_query_session KqpQuerySession.NoLocalAttach
2839
ydb/tests/functional/postgresql test_postgres.py.TestPostgresSuite.test_postgres_suite*
2940
ydb/tests/functional/restarts test_restarts.py.*
3041
ydb/tests/functional/sqs/cloud test_yandex_cloud_mode.py.TestSqsYandexCloudMode.test_dlq_mechanics_in_cloud*
42+
ydb/tests/functional/sqs/cloud test_yandex_cloud_queue_counters.py.TestYmqQueueCounters.test_purge_queue_counters
43+
ydb/tests/functional/sqs/common test_queue_counters.py.TestSqsGettingCounters.test_purge_queue_counters
3144
ydb/tests/functional/tenants test_dynamic_tenants.py.*
3245
ydb/tests/functional/tenants test_storage_config.py.TestStorageConfig.*
3346
ydb/tests/functional/tenants test_tenants.py.*
3447
ydb/tests/functional/ydb_cli test_ydb_scripting.py.TestScriptingServiceHelp.test_help
3548
ydb/tests/functional/ydb_cli test_ydb_scripting.py.TestScriptingServiceHelp.test_help_ex
49+
ydb/tests/tools/pq_read/test test_timeout.py.TestTimeout.test_timeout

ROADMAP.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ We use the following symbols as abbreviations:
2323
1. ㉔ Support for **temporary tables**
2424
1. ㉔ Support for **VIEW** SQL clause
2525
1.**Data Spilling** in case there is issufient amount of RAM
26-
1.**TPC-H, TPC-H for 100TB** dataset
26+
1.**TPC-H, TPC-DS for 100TB** dataset
2727
1. ✅ ㉓ Support for **Snapshot Readonly** transactions mode
2828
1. 🚧 ㉓ **Better resource management** for KQP Resource Manager (share information about nodes resources, avoid OOMs)
2929
1. ✅ ㉓ Switch to **New Engine** for OLTP queries

ydb/core/base/logoblob.cpp

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,26 @@
11
#include "logoblob.h"
22
#include <ydb/core/protos/base.pb.h>
3-
#include <util/string/printf.h>
43

54
namespace NKikimr {
65

76
TString TLogoBlobID::ToString() const {
8-
return Sprintf(
9-
"[%" PRIu64 ":%" PRIu32 ":%" PRIu32 ":%" PRIu32 ":%" PRIu32 ":%" PRIu32 ":%" PRIu32 "]",
10-
TabletID(),
11-
Generation(),
12-
Step(),
13-
Channel(),
14-
Cookie(),
15-
BlobSize(),
16-
PartId()).data();
7+
TString str;
8+
str.reserve(64);
9+
TStringOutput outStr(str);
10+
Out(outStr);
11+
return str;
1712
}
1813

1914
void TLogoBlobID::Out(IOutputStream &o) const {
20-
char buf[240];
21-
snprintf(buf, sizeof(buf),
22-
"[%" PRIu64 ":%" PRIu32 ":%" PRIu32 ":%" PRIu32 ":%" PRIu32 ":%" PRIu32 ":%" PRIu32 "]",
23-
TabletID(),
24-
Generation(),
25-
Step(),
26-
Channel(),
27-
Cookie(),
28-
BlobSize(),
29-
PartId()
30-
);
31-
32-
o << buf;
15+
o << '['
16+
<< TabletID() << ':'
17+
<< Generation() << ':'
18+
<< Step() << ':'
19+
<< Channel() << ':'
20+
<< Cookie() << ':'
21+
<< BlobSize() << ':'
22+
<< PartId()
23+
<< ']' ;
3324
}
3425

3526
void TLogoBlobID::Out(IOutputStream &o, const TVector<TLogoBlobID> &vec) {

ydb/core/base/traceid.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,15 @@ TTraceID TTraceID::GenerateNew() {
2020
}
2121

2222
TString TTraceID::ToString() const {
23-
TString result;
24-
TStringOutput out(result);
25-
Out(out);
26-
return result;
23+
TString str;
24+
str.reserve(128);
25+
TStringOutput outStr(str);
26+
Out(outStr);
27+
return str;
2728
}
2829

2930
void TTraceID::Out(IOutputStream &o) const {
30-
char buf[240];
31-
snprintf(buf, sizeof(buf), "[ID:%" PRIu64 ", Created: %s]", RandomID, TInstant::MicroSeconds(CreationTime).ToRfc822StringLocal().data());
32-
o << buf;
31+
o << "[ID: " << RandomID << ", " << "Created: " << TInstant::MicroSeconds(CreationTime).ToRfc822StringLocal() << "]";
3332
}
3433

3534
bool TTraceID::operator<(const TTraceID &x) const {

ydb/core/formats/arrow/converter.cpp

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
#include "converter.h"
22
#include "switch_type.h"
33

4+
#include <ydb/library/binary_json/read.h>
45
#include <ydb/library/binary_json/write.h>
56
#include <ydb/library/dynumber/dynumber.h>
67

8+
#include <util/generic/set.h>
79
#include <util/memory/pool.h>
810
#include <library/cpp/containers/stack_vector/stack_vec.h>
911

@@ -47,16 +49,21 @@ static bool ConvertData(TCell& cell, const NScheme::TTypeInfo& colType, TMemoryP
4749
}
4850

4951
static bool ConvertColumn(const NScheme::TTypeInfo colType, std::shared_ptr<arrow::Array>& column, std::shared_ptr<arrow::Field>& field) {
50-
if (colType.GetTypeId() == NScheme::NTypeIds::Decimal) {
52+
switch (colType.GetTypeId()) {
53+
case NScheme::NTypeIds::Decimal:
5154
return false;
55+
case NScheme::NTypeIds::JsonDocument: {
56+
const static TSet<arrow::Type::type> jsonDocArrowTypes{ arrow::Type::BINARY, arrow::Type::STRING };
57+
if (!jsonDocArrowTypes.contains(column->type()->id())) {
58+
return false;
59+
}
60+
break;
5261
}
53-
54-
if ((colType.GetTypeId() == NScheme::NTypeIds::JsonDocument) &&
55-
(column->type()->id() == arrow::Type::BINARY || column->type()->id() == arrow::Type::STRING))
56-
{
57-
;
58-
} else if (column->type()->id() != arrow::Type::BINARY) {
59-
return false;
62+
default:
63+
if (column->type()->id() != arrow::Type::BINARY) {
64+
return false;
65+
}
66+
break;
6067
}
6168

6269
auto& binaryArray = static_cast<arrow::BinaryArray&>(*column);
@@ -81,9 +88,16 @@ static bool ConvertColumn(const NScheme::TTypeInfo colType, std::shared_ptr<arro
8188
Y_ABORT_UNLESS(builder.AppendNull().ok());
8289
continue;
8390
}
84-
const auto binaryJson = NBinaryJson::SerializeToBinaryJson(TStringBuf(value.data(), value.size()));
85-
if (!binaryJson.Defined() || !builder.Append(binaryJson->Data(), binaryJson->Size()).ok()) {
86-
return false;
91+
const TStringBuf valueBuf(value.data(), value.size());
92+
if (NBinaryJson::IsValidBinaryJson(valueBuf)) {
93+
if (!builder.Append(value).ok()) {
94+
return false;
95+
}
96+
} else {
97+
const auto binaryJson = NBinaryJson::SerializeToBinaryJson(valueBuf);
98+
if (!binaryJson.Defined() || !builder.Append(binaryJson->Data(), binaryJson->Size()).ok()) {
99+
return false;
100+
}
87101
}
88102
}
89103
}

ydb/core/fq/libs/checkpointing/checkpoint_coordinator.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,12 @@ void TCheckpointCoordinator::Handle(NYql::NDqs::TEvReadyState::TPtr& ev) {
103103
AllActorsSet.insert(actorId);
104104
}
105105

106+
CC_LOG_D("ActorsToTrigger count: " << ActorsToTrigger.size() << ", ActorsToNotify count: " << ActorsToNotify.size() << ", ActorsToWaitFor count: " << ActorsToWaitFor.size());
107+
108+
if (ActorsToTrigger.empty()) {
109+
CC_LOG_D("No ingress tasks, coordinator was disabled");
110+
return;
111+
}
106112
PendingInit = std::make_unique<TPendingInitCoordinator>(AllActors.size());
107113

108114
CC_LOG_D("Send TEvRegisterCoordinatorRequest");

ydb/core/fq/libs/checkpointing/ut/checkpoint_coordinator_ut.cpp

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ enum ETestGraphFlags : ui64 {
1919
SourceWithChannelInOneTask = 2,
2020
};
2121

22-
NYql::NDqProto::TReadyState BuildTestGraph(ui64 flags = 0) {
22+
NYql::NDqProto::TReadyState BuildTestGraph(ui64 flags, const TString& sourceType) {
2323

2424
NYql::NDqProto::TReadyState result;
2525

@@ -29,7 +29,7 @@ NYql::NDqProto::TReadyState BuildTestGraph(ui64 flags = 0) {
2929
ingressOutput->AddChannels();
3030
if (flags & ETestGraphFlags::InputWithSource) {
3131
auto* source = ingress->AddInputs()->MutableSource();
32-
source->SetType("PqSource");
32+
source->SetType(sourceType);
3333
}
3434

3535
auto* map = result.AddTask();
@@ -40,7 +40,7 @@ NYql::NDqProto::TReadyState BuildTestGraph(ui64 flags = 0) {
4040
mapOutput->AddChannels();
4141
if (flags & ETestGraphFlags::SourceWithChannelInOneTask) {
4242
auto* source = map->AddInputs()->MutableSource();
43-
source->SetType("PqSource");
43+
source->SetType(sourceType);
4444
}
4545

4646
auto* egress = result.AddTask();
@@ -70,9 +70,9 @@ struct TTestBootstrap : public TTestActorRuntime {
7070

7171
::NMonitoring::TDynamicCounterPtr Counters = new ::NMonitoring::TDynamicCounters();
7272

73-
explicit TTestBootstrap(ui64 graphFlags = 0)
73+
explicit TTestBootstrap(ui64 graphFlags, const TString& sourceType)
7474
: TTestActorRuntime(true)
75-
, GraphState(BuildTestGraph(graphFlags))
75+
, GraphState(BuildTestGraph(graphFlags, sourceType))
7676
, CoordinatorId("my-graph-id", 42)
7777
, CheckpointId(CoordinatorId.Generation, 1)
7878
{
@@ -281,8 +281,8 @@ Y_UNIT_TEST_SUITE(TCheckpointCoordinatorTests) {
281281
class CheckpointsTestHelper : public TTestBootstrap
282282
{
283283
public:
284-
CheckpointsTestHelper(ui64 graphFlags)
285-
: TTestBootstrap(graphFlags) {
284+
CheckpointsTestHelper(ui64 graphFlags, const TString& sourceType)
285+
: TTestBootstrap(graphFlags, sourceType) {
286286
}
287287

288288
void InjectCheckpoint() {
@@ -372,22 +372,33 @@ Y_UNIT_TEST_SUITE(TCheckpointCoordinatorTests) {
372372
};
373373

374374
Y_UNIT_TEST(ShouldTriggerCheckpointWithSource) {
375-
CheckpointsTestHelper test(ETestGraphFlags::InputWithSource);
375+
CheckpointsTestHelper test(ETestGraphFlags::InputWithSource, "PqSource");
376376
test.InjectCheckpoint();
377377
test.AllSavedAndCommited();
378378
}
379379

380380
Y_UNIT_TEST(ShouldTriggerCheckpointWithSourcesAndWithChannel) {
381-
CheckpointsTestHelper test(ETestGraphFlags::InputWithSource | ETestGraphFlags::SourceWithChannelInOneTask);
381+
CheckpointsTestHelper test(ETestGraphFlags::InputWithSource | ETestGraphFlags::SourceWithChannelInOneTask, "PqSource");
382382
test.InjectCheckpoint();
383383
test.AllSavedAndCommited();
384384
}
385385

386386
Y_UNIT_TEST(ShouldAbortPreviousCheckpointsIfNodeStateCantBeSaved) {
387-
CheckpointsTestHelper test(ETestGraphFlags::InputWithSource);
387+
CheckpointsTestHelper test(ETestGraphFlags::InputWithSource, "PqSource");
388388
test.InjectCheckpoint();
389389
test.SaveFailed();
390390
}
391+
392+
Y_UNIT_TEST(ShouldDoNothingIfNoIngressTasks) {
393+
CheckpointsTestHelper test(ETestGraphFlags::InputWithSource, "S3Source");
394+
bool empty = false;
395+
try {
396+
test.GrabEdgeEvent<TEvCheckpointStorage::TEvRegisterCoordinatorRequest>(test.StorageProxy, TDuration::Seconds(10));
397+
} catch (TEmptyEventQueueException&) {
398+
empty = true;
399+
}
400+
UNIT_ASSERT(empty);
401+
}
391402
}
392403

393404
} // namespace NFq

0 commit comments

Comments
 (0)