Skip to content

Commit df6b3bb

Browse files
authored
Merge 006858e into 9800792
2 parents 9800792 + 006858e commit df6b3bb

File tree

6 files changed

+66
-30
lines changed

6 files changed

+66
-30
lines changed

ydb/core/kqp/runtime/kqp_write_actor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,7 @@ class TKqpTableWriteActor : public TActorBootstrapped<TKqpTableWriteActor> {
11031103
void RetryShard(const ui64 shardId, const std::optional<ui64> ifCookieEqual) {
11041104
const auto metadata = ShardedWriteController->GetMessageMetadata(shardId);
11051105
if (!metadata || (ifCookieEqual && metadata->Cookie != ifCookieEqual)) {
1106-
CA_LOG_W("Retry failed: not found ShardID=" << shardId << " with Cookie=" << ifCookieEqual.value_or(0));
1106+
CA_LOG_I("Retry failed: not found ShardID=" << shardId << " with Cookie=" << ifCookieEqual.value_or(0));
11071107
return;
11081108
}
11091109

@@ -1119,7 +1119,7 @@ class TKqpTableWriteActor : public TActorBootstrapped<TKqpTableWriteActor> {
11191119
}
11201120

11211121
void Handle(TEvPrivate::TEvShardRequestTimeout::TPtr& ev) {
1122-
CA_LOG_W("Timeout shardID=" << ev->Get()->ShardId);
1122+
CA_LOG_I("Timeout shardID=" << ev->Get()->ShardId);
11231123
YQL_ENSURE(InconsistentTx);
11241124
RetryShard(ev->Get()->ShardId, ev->Cookie);
11251125
}

ydb/core/tx/schemeshard/schemeshard__background_cleaning.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ NOperationQueue::EStartStatus TSchemeShard::StartBackgroundCleaning(const TPathI
6262
auto ctx = ActorContext();
6363
LOG_INFO_S(ctx, NKikimrServices::FLAT_TX_SCHEMESHARD, "RunBackgroundCleaning "
6464
"for temp dir# " << JoinPath({info->WorkingDir, info->Name})
65+
<< ", pathId# " << pathId
6566
<< ", ownerId# " << info->TempDirOwnerActorId
6667
<< ", next wakeup# " << BackgroundCleaningQueue->GetWakeupDelta()
6768
<< ", rate# " << BackgroundCleaningQueue->GetRate()
@@ -309,6 +310,13 @@ void TSchemeShard::RetryNodeSubscribe(ui32 nodeId) {
309310
}
310311

311312
retryState.RetryNumber++;
313+
auto ctx = ActorContext();
314+
LOG_INFO_S(ctx, NKikimrServices::FLAT_TX_SCHEMESHARD, "Retry node subscribe BackgroundCleaning "
315+
"for nodeId# " << nodeId
316+
<< ", count of retries# " << retryState.RetryNumber
317+
<< ", retries limit# " << BackgroundCleaningRetrySettings.GetMaxRetryNumber()
318+
<< ", last retry at# " << retryState.LastRetryAt
319+
<< " at schemeshard " << TabletID());
312320

313321
if (retryState.RetryNumber > BackgroundCleaningRetrySettings.GetMaxRetryNumber()) {
314322
for (const auto& ownerActorId: nodeState.Owners) {
@@ -359,6 +367,11 @@ bool TSchemeShard::CheckOwnerUndelivered(TEvents::TEvUndelivered::TPtr& ev) {
359367
}
360368

361369
auto& currentTempDirs = it->second;
370+
auto ctx = ActorContext();
371+
LOG_INFO_S(ctx, NKikimrServices::FLAT_TX_SCHEMESHARD, "Owner undelivered for BackgroundCleaning "
372+
"for ownerActorId# " << ownerActorId
373+
<< ", undelivered reason# " << ev->Get()->Reason
374+
<< " at schemeshard " << TabletID());
362375

363376
for (auto& pathId: currentTempDirs) {
364377
EnqueueBackgroundCleaning(pathId);

ydb/core/tx/schemeshard/schemeshard__init.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ struct TSchemeShard::TTxInit : public TTransactionBase<TSchemeShard> {
112112
rowSet.template GetValueOrDefault<typename SchemaTable::DirAlterVersion>(1),
113113
rowSet.template GetValueOrDefault<typename SchemaTable::UserAttrsAlterVersion>(1),
114114
rowSet.template GetValueOrDefault<typename SchemaTable::ACLVersion>(0),
115-
rowSet.template GetValueOrDefault<typename SchemaTable::TempDirOwnerActorId>()
115+
rowSet.template GetValueOrDefault<typename SchemaTable::TempDirOwnerActorIdProto>()
116116
);
117117
}
118118

@@ -138,7 +138,7 @@ struct TSchemeShard::TTxInit : public TTransactionBase<TSchemeShard> {
138138

139139
TPathElement::TPtr path = new TPathElement(pathId, parentPathId, domainId, name, owner);
140140

141-
TString tempDirOwnerActorId;
141+
TString tempDirOwnerActorIdProto;
142142
std::tie(
143143
std::ignore, //pathId
144144
std::ignore, //parentPathId
@@ -154,14 +154,16 @@ struct TSchemeShard::TTxInit : public TTransactionBase<TSchemeShard> {
154154
path->DirAlterVersion,
155155
path->UserAttrs->AlterVersion,
156156
path->ACLVersion,
157-
tempDirOwnerActorId) = rec;
157+
tempDirOwnerActorIdProto) = rec;
158158

159159
path->PathState = TPathElement::EPathState::EPathStateNoChanges;
160160
if (path->StepDropped) {
161161
path->PathState = TPathElement::EPathState::EPathStateNotExist;
162162
}
163163

164-
path->TempDirOwnerActorId.Parse(tempDirOwnerActorId.c_str(), tempDirOwnerActorId.size());
164+
if (NActorsProto::TActorId protoId; protoId.ParseFromString(tempDirOwnerActorIdProto)) {
165+
path->TempDirOwnerActorId = ActorIdFromProto(protoId);
166+
}
165167

166168
return path;
167169
}

ydb/core/tx/schemeshard/schemeshard_impl.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2111,6 +2111,10 @@ void TSchemeShard::PersistLastTxId(NIceDb::TNiceDb& db, const TPathElement::TPtr
21112111
void TSchemeShard::PersistPath(NIceDb::TNiceDb& db, const TPathId& pathId) {
21122112
Y_ABORT_UNLESS(PathsById.contains(pathId));
21132113
TPathElement::TPtr elem = PathsById.at(pathId);
2114+
2115+
NActorsProto::TActorId tempDirOwnerActorIdProto;
2116+
ActorIdToProto(elem->TempDirOwnerActorId, &tempDirOwnerActorIdProto);
2117+
21142118
if (IsLocalId(pathId)) {
21152119
db.Table<Schema::Paths>().Key(pathId.LocalPathId).Update(
21162120
NIceDb::TUpdate<Schema::Paths::ParentOwnerId>(elem->ParentPathId.OwnerId),
@@ -2127,7 +2131,8 @@ void TSchemeShard::PersistPath(NIceDb::TNiceDb& db, const TPathId& pathId) {
21272131
NIceDb::TUpdate<Schema::Paths::DirAlterVersion>(elem->DirAlterVersion),
21282132
NIceDb::TUpdate<Schema::Paths::UserAttrsAlterVersion>(elem->UserAttrs->AlterVersion),
21292133
NIceDb::TUpdate<Schema::Paths::ACLVersion>(elem->ACLVersion),
2130-
NIceDb::TUpdate<Schema::Paths::TempDirOwnerActorId>(elem->TempDirOwnerActorId.ToString())
2134+
NIceDb::TUpdate<Schema::Paths::TempDirOwnerActorId>(elem->TempDirOwnerActorId.ToString()),
2135+
NIceDb::TUpdate<Schema::Paths::TempDirOwnerActorIdProto>(tempDirOwnerActorIdProto.SerializeAsString())
21312136
);
21322137
} else {
21332138
db.Table<Schema::MigratedPaths>().Key(pathId.OwnerId, pathId.LocalPathId).Update(
@@ -2145,7 +2150,8 @@ void TSchemeShard::PersistPath(NIceDb::TNiceDb& db, const TPathId& pathId) {
21452150
NIceDb::TUpdate<Schema::MigratedPaths::DirAlterVersion>(elem->DirAlterVersion),
21462151
NIceDb::TUpdate<Schema::MigratedPaths::UserAttrsAlterVersion>(elem->UserAttrs->AlterVersion),
21472152
NIceDb::TUpdate<Schema::MigratedPaths::ACLVersion>(elem->ACLVersion),
2148-
NIceDb::TUpdate<Schema::MigratedPaths::TempDirOwnerActorId>(elem->TempDirOwnerActorId.ToString())
2153+
NIceDb::TUpdate<Schema::MigratedPaths::TempDirOwnerActorId>(elem->TempDirOwnerActorId.ToString()),
2154+
NIceDb::TUpdate<Schema::MigratedPaths::TempDirOwnerActorIdProto>(tempDirOwnerActorIdProto.SerializeAsString())
21492155
);
21502156
}
21512157
}

ydb/core/tx/schemeshard/schemeshard_schema.h

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,15 @@ struct Schema : NIceDb::Schema {
3535
struct UserAttrsAlterVersion : Column<14, NScheme::NTypeIds::Uint64> {};
3636
struct ACLVersion : Column<15, NScheme::NTypeIds::Uint64> {};
3737
struct ParentOwnerId : Column<16, NScheme::NTypeIds::Uint64> { using Type = TOwnerId; static constexpr Type Default = InvalidOwnerId; };
38-
struct TempDirOwnerActorId : Column<17, NScheme::NTypeIds::String> {}; // Only for EPathType::EPathTypeDir.
39-
// Not empty if dir must be deleted after loosing connection with TempDirOwnerActorId actor.
40-
// See schemeshard__background_cleaning.cpp.
38+
struct TempDirOwnerActorId : Column<17, NScheme::NTypeIds::String> {}; // legacy
39+
struct TempDirOwnerActorIdProto : Column<18, NScheme::NTypeIds::String> {}; // Only for EPathType::EPathTypeDir.
40+
// Not empty if dir must be deleted after loosing connection with TempDirOwnerActorId actor.
41+
// See schemeshard__background_cleaning.cpp.
4142

4243
using TKey = TableKey<Id>;
4344
using TColumns = TableColumns<Id, ParentId, Name, CreateFinished, PathType, StepCreated, CreateTxId,
4445
StepDropped, DropTxId, Owner, ACL, LastTxId, DirAlterVersion, UserAttrsAlterVersion, ACLVersion,
45-
ParentOwnerId, TempDirOwnerActorId>;
46+
ParentOwnerId, TempDirOwnerActorId, TempDirOwnerActorIdProto>;
4647
};
4748

4849
struct MigratedPaths : Table<50> {
@@ -62,13 +63,15 @@ struct Schema : NIceDb::Schema {
6263
struct DirAlterVersion : Column<14, NScheme::NTypeIds::Uint64> {};
6364
struct UserAttrsAlterVersion : Column<15, NScheme::NTypeIds::Uint64> {};
6465
struct ACLVersion : Column<16, NScheme::NTypeIds::Uint64> {};
65-
struct TempDirOwnerActorId : Column<17, NScheme::NTypeIds::String> {}; // Only for EPathType::EPathTypeDir.
66-
// Not empty if dir must be deleted after loosing connection with TempDirOwnerActorId actor.
67-
// See schemeshard__background_cleaning.cpp.
66+
struct TempDirOwnerActorId : Column<17, NScheme::NTypeIds::String> {}; // legacy
67+
struct TempDirOwnerActorIdProto : Column<18, NScheme::NTypeIds::String> {}; // Only for EPathType::EPathTypeDir.
68+
// Not empty if dir must be deleted after loosing connection with TempDirOwnerActorId actor.
69+
// See schemeshard__background_cleaning.cpp.
6870

6971
using TKey = TableKey<OwnerPathId, LocalPathId>;
7072
using TColumns = TableColumns<OwnerPathId, LocalPathId, ParentOwnerId, ParentLocalId, Name, PathType, StepCreated, CreateTxId,
71-
StepDropped, DropTxId, Owner, ACL, LastTxId, DirAlterVersion, UserAttrsAlterVersion, ACLVersion, TempDirOwnerActorId>;
73+
StepDropped, DropTxId, Owner, ACL, LastTxId, DirAlterVersion, UserAttrsAlterVersion, ACLVersion, TempDirOwnerActorId,
74+
TempDirOwnerActorIdProto>;
7275
};
7376

7477
struct TxInFlight : Table<2> { // not in use

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

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
1
77
],
88
"ColumnsAdded": [
9-
{
10-
"ColumnId": 17,
11-
"ColumnName": "TempDirOwnerActorId",
12-
"ColumnType": "String"
13-
},
149
{
1510
"ColumnId": 1,
1611
"ColumnName": "Id",
@@ -90,13 +85,22 @@
9085
"ColumnId": 16,
9186
"ColumnName": "ParentOwnerId",
9287
"ColumnType": "Uint64"
88+
},
89+
{
90+
"ColumnId": 17,
91+
"ColumnName": "TempDirOwnerActorId",
92+
"ColumnType": "String"
93+
},
94+
{
95+
"ColumnId": 18,
96+
"ColumnName": "TempDirOwnerActorIdProto",
97+
"ColumnType": "String"
9398
}
9499
],
95100
"ColumnsDropped": [],
96101
"ColumnFamilies": {
97102
"0": {
98103
"Columns": [
99-
17,
100104
1,
101105
2,
102106
3,
@@ -112,7 +116,9 @@
112116
13,
113117
14,
114118
15,
115-
16
119+
16,
120+
17,
121+
18
116122
],
117123
"RoomID": 0,
118124
"Codec": 0,
@@ -3537,11 +3543,6 @@
35373543
2
35383544
],
35393545
"ColumnsAdded": [
3540-
{
3541-
"ColumnId": 17,
3542-
"ColumnName": "TempDirOwnerActorId",
3543-
"ColumnType": "String"
3544-
},
35453546
{
35463547
"ColumnId": 1,
35473548
"ColumnName": "OwnerPathId",
@@ -3621,13 +3622,22 @@
36213622
"ColumnId": 16,
36223623
"ColumnName": "ACLVersion",
36233624
"ColumnType": "Uint64"
3625+
},
3626+
{
3627+
"ColumnId": 17,
3628+
"ColumnName": "TempDirOwnerActorId",
3629+
"ColumnType": "String"
3630+
},
3631+
{
3632+
"ColumnId": 18,
3633+
"ColumnName": "TempDirOwnerActorIdProto",
3634+
"ColumnType": "String"
36243635
}
36253636
],
36263637
"ColumnsDropped": [],
36273638
"ColumnFamilies": {
36283639
"0": {
36293640
"Columns": [
3630-
17,
36313641
1,
36323642
2,
36333643
3,
@@ -3643,7 +3653,9 @@
36433653
13,
36443654
14,
36453655
15,
3646-
16
3656+
16,
3657+
17,
3658+
18
36473659
],
36483660
"RoomID": 0,
36493661
"Codec": 0,

0 commit comments

Comments
 (0)