Skip to content

Commit 3b7958e

Browse files
authored
Merge 74ee595 into 50db96b
2 parents 50db96b + 74ee595 commit 3b7958e

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

ydb/core/protos/flat_scheme_op.proto

+1
Original file line numberDiff line numberDiff line change
@@ -1482,6 +1482,7 @@ message TApplyIf {
14821482
optional uint64 PathId = 1;
14831483
optional uint64 PathVersion = 2;
14841484
optional uint64 LockedTxId = 3;
1485+
optional bool CheckGeneralVersion = 4 [default = true];
14851486
}
14861487

14871488
message TUpgradeSubDomain {

ydb/core/tx/schemeshard/schemeshard_impl.cpp

+17-1
Original file line numberDiff line numberDiff line change
@@ -1227,7 +1227,23 @@ bool TSchemeShard::CheckApplyIf(const NKikimrSchemeOp::TModifyScheme &scheme, TS
12271227

12281228
if (item.HasPathVersion()) {
12291229
const auto requiredVersion = item.GetPathVersion();
1230-
const auto actualVersion = GetPathVersion(TPath::Init(pathId, this)).GetGeneralVersion();
1230+
arc_ui64 actualVersion;
1231+
auto path = TPath::Init(pathId, this);
1232+
auto pathVersion = GetPathVersion(path);
1233+
1234+
if (item.HasCheckGeneralVersion() && !item.GetCheckGeneralVersion()) {
1235+
switch(path.Base()->PathType) {
1236+
case NKikimrSchemeOp::EPathTypePersQueueGroup:
1237+
actualVersion = pathVersion.GetPQVersion();
1238+
break;
1239+
default:
1240+
actualVersion = pathVersion.GetGeneralVersion();
1241+
break;
1242+
}
1243+
} else {
1244+
actualVersion = pathVersion.GetGeneralVersion();
1245+
}
1246+
12311247
if (requiredVersion != actualVersion) {
12321248
errStr = TStringBuilder()
12331249
<< "fail user constraint in ApplyIf section:"

0 commit comments

Comments
 (0)