summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Rutkovsky <[email protected]>2022-02-09 11:29:21 +0300
committerDaniil Cherednik <[email protected]>2022-02-10 15:58:17 +0300
commit01ba7196442746b0bd0dc5b2ca128ee73eeb25b7 (patch)
treeac3f6bf6a4de67b1ce688cf843341f94f8911792
parent03edfd7d466b46b7989ef84c5b4e352f797365dd (diff)
Fix node registration KIKIMR-14249
ref:c452723dadc27a556b512e47460d3c407a8bdbdb
-rw-r--r--library/cpp/actors/core/interconnect.cpp21
-rw-r--r--library/cpp/actors/core/interconnect.h7
-rw-r--r--ydb/public/lib/deprecated/kicli/kikimr.cpp1
3 files changed, 19 insertions, 10 deletions
diff --git a/library/cpp/actors/core/interconnect.cpp b/library/cpp/actors/core/interconnect.cpp
index 9fb33413b26..a42278e669e 100644
--- a/library/cpp/actors/core/interconnect.cpp
+++ b/library/cpp/actors/core/interconnect.cpp
@@ -31,18 +31,19 @@ namespace NActors {
temp.ClearRackNum();
temp.ClearBodyNum();
- // legacy format must not interfere with new one
const NProtoBuf::Reflection *reflection = temp.GetReflection();
- for (int i = 0, count = descriptor->field_count(); i < count; ++i) {
- Y_VERIFY(!reflection->HasField(temp, descriptor->field(i)));
+ bool fieldsFromNewFormat = false;
+ for (int i = 0, count = descriptor->field_count(); !fieldsFromNewFormat && i < count; ++i) {
+ fieldsFromNewFormat |= reflection->HasField(temp, descriptor->field(i));
+ }
+ if (!fieldsFromNewFormat) {
+ const auto& v = LegacyValue->DataCenter;
+ const char *p = reinterpret_cast<const char*>(&v);
+ temp.SetDataCenter(TString(p, strnlen(p, sizeof(ui32))));
+ temp.SetModule(::ToString(LegacyValue->Room));
+ temp.SetRack(::ToString(LegacyValue->Rack));
+ temp.SetUnit(::ToString(LegacyValue->Body));
}
-
- const auto& v = LegacyValue->DataCenter;
- const char *p = reinterpret_cast<const char*>(&v);
- temp.SetDataCenter(TString(p, strnlen(p, sizeof(ui32))));
- temp.SetModule(::ToString(LegacyValue->Room));
- temp.SetRack(::ToString(LegacyValue->Rack));
- temp.SetUnit(::ToString(LegacyValue->Body));
}
auto makeString = [&] {
diff --git a/library/cpp/actors/core/interconnect.h b/library/cpp/actors/core/interconnect.h
index 8d1cbd1e77c..679a4b8cc6f 100644
--- a/library/cpp/actors/core/interconnect.h
+++ b/library/cpp/actors/core/interconnect.h
@@ -39,6 +39,13 @@ namespace NActors {
}
friend bool operator ==(const TLegacyValue& x, const TLegacyValue& y) { return x.Compare(y) == 0; }
+
+ void Serialize(NActorsInterconnect::TNodeLocation *pb) const {
+ pb->SetDataCenterNum(DataCenter);
+ pb->SetRoomNum(Room);
+ pb->SetRackNum(Rack);
+ pb->SetBodyNum(Body);
+ }
};
private:
diff --git a/ydb/public/lib/deprecated/kicli/kikimr.cpp b/ydb/public/lib/deprecated/kicli/kikimr.cpp
index c069dbb3db8..4156d72d4b3 100644
--- a/ydb/public/lib/deprecated/kicli/kikimr.cpp
+++ b/ydb/public/lib/deprecated/kicli/kikimr.cpp
@@ -585,6 +585,7 @@ NThreading::TFuture<TResult> TKikimr::RegisterNode(const TString& domainPath, co
request->Record.SetAddress(address);
request->Record.SetResolveHost(resolveHost);
location.Serialize(request->Record.MutableLocation());
+ location.GetLegacyValue().Serialize(request->Record.MutableLocation());
request->Record.SetDomainPath(domainPath);
request->Record.SetFixedNodeId(fixedNodeId);
if (path) {