Skip to content

Commit

Permalink
Add compatibility info
Browse files Browse the repository at this point in the history
  • Loading branch information
serbel324 committed Feb 5, 2024
1 parent 6149d92 commit 59e0018
Showing 1 changed file with 33 additions and 5 deletions.
38 changes: 33 additions & 5 deletions ydb/core/driver_lib/version/version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,44 @@ using TComponentId = NKikimrConfig::TCompatibilityRule::EComponentId;
TCompatibilityInfo::TCompatibilityInfo() {
using TCurrentConstructor = TCompatibilityInfo::TProtoConstructor::TCurrentCompatibilityInfo;
using TStoredConstructor = TCompatibilityInfo::TProtoConstructor::TStoredCompatibilityInfo;
// using TCompatibilityRuleConstructor = TCompatibilityInfo::TProtoConstructor::TCompatibilityRule;
using TCompatibilityRuleConstructor = TCompatibilityInfo::TProtoConstructor::TCompatibilityRule;
using TVersionConstructor = TCompatibilityInfo::TProtoConstructor::TVersion;

/////////////////////////////////////////////////////////
// Current CompatibilityInfo
/////////////////////////////////////////////////////////

auto current = TCurrentConstructor{
.Application = "ydb"
.Application = "ydb",
.Version = TVersionConstructor{
.Year = 24,
.Major = 1,
},
.CanConnectTo = {
TCompatibilityRuleConstructor{
.Application = "ydb",
.LowerLimit = TVersionConstructor{ .Year = 23, .Major = 3 },
.UpperLimit = TVersionConstructor{ .Year = 24, .Major = 1 },
},
},
.CanLoadFrom = {
TCompatibilityRuleConstructor{
.Application = "ydb",
.LowerLimit = TVersionConstructor{ .Year = 23, .Major = 3 },
.UpperLimit = TVersionConstructor{ .Year = 24, .Major = 1 },
},
},
.StoresReadableBy = {
TCompatibilityRuleConstructor{
.Application = "ydb",
.LowerLimit = TVersionConstructor{ .Year = 23, .Major = 3 },
.UpperLimit = TVersionConstructor{ .Year = 24, .Major = 1 },
},
}
}.ToPB();

// bool success = CompleteFromTag(current);
bool success = CompleteFromTag(current);
Y_UNUSED(success);
// Y_ABORT_UNLESS(success);

CurrentCompatibilityInfo.CopyFrom(current);
Expand Down Expand Up @@ -76,12 +102,14 @@ const TStored* TCompatibilityInfo::GetDefault(TComponentId componentId) const {
// obsolete version control
TMaybe<NActors::TInterconnectProxyCommon::TVersionInfo> VERSION = NActors::TInterconnectProxyCommon::TVersionInfo{
// version of this binary
"trunk",
"stable-24-1",

// compatible versions; must include all compatible old ones, including this one; version verification occurs on both
// peers and connection is accepted if at least one of peers accepts the version of the other peer
{
"trunk"
"stable-23-3",
"stable-23-4",
"stable-24-1"
}
};

Expand Down

0 comments on commit 59e0018

Please sign in to comment.