diff --git a/ydb/core/driver_lib/version/ut/version_ut.cpp b/ydb/core/driver_lib/version/ut/version_ut.cpp index ae864fe668e7..c9c1b2eddf92 100644 --- a/ydb/core/driver_lib/version/ut/version_ut.cpp +++ b/ydb/core/driver_lib/version/ut/version_ut.cpp @@ -50,11 +50,11 @@ Y_UNIT_TEST_SUITE(YdbVersion) { Test( TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 1, .Hotfix = 0 } + .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 1, .Patch = 1, .Hotfix = 0 } }, TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 1, .Hotfix = 0 } + .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 1, .Patch = 1, .Hotfix = 0 } }, true ); @@ -63,11 +63,11 @@ Y_UNIT_TEST_SUITE(YdbVersion) { Test( TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 2, .Minor = 1, .Hotfix = 0 } + .Version = TVersion{ .Year = 1, .Major = 2, .Minor = 1, .Patch = 1, .Hotfix = 0 } }, TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 1, .Hotfix = 10 } + .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 1, .Patch = 1, .Hotfix = 10 } }, true ); @@ -76,11 +76,11 @@ Y_UNIT_TEST_SUITE(YdbVersion) { Test( TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 8, .Hotfix = 0 } + .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 8, .Patch = 1, .Hotfix = 0 } }, TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 2, .Minor = 1, .Hotfix = 0 } + .Version = TVersion{ .Year = 1, .Major = 2, .Minor = 1, .Patch = 1, .Hotfix = 0 } }, true ); @@ -89,11 +89,11 @@ Y_UNIT_TEST_SUITE(YdbVersion) { Test( TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 1, .Hotfix = 10 } + .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 1, .Patch = 1, .Hotfix = 10 } }, TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 1, .Hotfix = 0 } + .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 1, .Patch = 1, .Hotfix = 0 } }, true ); @@ -102,11 +102,11 @@ Y_UNIT_TEST_SUITE(YdbVersion) { Test( TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 2, .Minor = 1, .Hotfix = 10 } + .Version = TVersion{ .Year = 1, .Major = 2, .Minor = 1, .Patch = 9, .Hotfix = 10 } }, TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 10, .Hotfix = 0 } + .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 10, .Patch = 1, .Hotfix = 0 } }, true ); @@ -115,11 +115,11 @@ Y_UNIT_TEST_SUITE(YdbVersion) { Test( TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 2, .Major = 1, .Minor = 1, .Hotfix = 0 } + .Version = TVersion{ .Year = 2, .Major = 1, .Minor = 1, .Patch = 1, .Hotfix = 0 } }, TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 1, .Hotfix = 0 } + .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 1, .Patch = 1, .Hotfix = 0 } }, false ); @@ -128,11 +128,11 @@ Y_UNIT_TEST_SUITE(YdbVersion) { Test( TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 1, .Hotfix = 0 } + .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 1, .Patch = 1, .Hotfix = 0 } }, TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 2, .Major = 1, .Minor = 1, .Hotfix = 0 } + .Version = TVersion{ .Year = 2, .Major = 1, .Minor = 1, .Patch = 1, .Hotfix = 0 } }, false ); @@ -141,11 +141,11 @@ Y_UNIT_TEST_SUITE(YdbVersion) { Test( TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 3, .Minor = 1, .Hotfix = 0 } + .Version = TVersion{ .Year = 1, .Major = 3, .Minor = 1, .Patch = 1, .Hotfix = 0 } }, TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 3, .Hotfix = 0 } + .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 3, .Patch = 1, .Hotfix = 0 } }, false ); @@ -154,11 +154,11 @@ Y_UNIT_TEST_SUITE(YdbVersion) { Test( TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 1, .Hotfix = 0 } + .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 1, .Patch = 1, .Hotfix = 0 } }, TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 3, .Minor = 1, .Hotfix = 0 } + .Version = TVersion{ .Year = 1, .Major = 3, .Minor = 1, .Patch = 1, .Hotfix = 0 } }, false ); @@ -167,11 +167,11 @@ Y_UNIT_TEST_SUITE(YdbVersion) { Test( TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 1, .Hotfix = 0 } + .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 1, .Patch = 1, .Hotfix = 0 } }, TCurrentCompatibilityInfo{ .Application = "nbs", - .Version = TVersion{ .Year = 1, .Major = 2, .Minor = 1, .Hotfix = 0 } + .Version = TVersion{ .Year = 1, .Major = 2, .Minor = 1, .Patch = 1, .Hotfix = 0 } }, true ); @@ -180,11 +180,11 @@ Y_UNIT_TEST_SUITE(YdbVersion) { Test( TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 1, .Hotfix = 0 }, + .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 1, .Patch = 1, .Hotfix = 0 }, }, TCurrentCompatibilityInfo{ .Application = "nbs", - .Version = TVersion{ .Year = 1, .Major = 3, .Minor = 1, .Hotfix = 0 }, + .Version = TVersion{ .Year = 1, .Major = 3, .Minor = 1, .Patch = 1, .Hotfix = 0 }, }, false ); @@ -193,7 +193,7 @@ Y_UNIT_TEST_SUITE(YdbVersion) { Test( TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 2, .Minor = 1, .Hotfix = 0 }, + .Version = TVersion{ .Year = 1, .Major = 2, .Minor = 1, .Patch = 1, .Hotfix = 0 }, .CanLoadFrom = { TCompatibilityRule{ .LowerLimit = TVersion{ .Year = 1, .Major = 1 }, @@ -204,7 +204,7 @@ Y_UNIT_TEST_SUITE(YdbVersion) { }, TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 2, .Hotfix = 1 } + .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 2, .Patch = 1, .Hotfix = 1 } }, false ); @@ -213,15 +213,15 @@ Y_UNIT_TEST_SUITE(YdbVersion) { Test( TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 1, .Hotfix = 3 }, + .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 1, .Patch = 1, .Hotfix = 3 }, }, TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 2, .Minor = 2, .Hotfix = 0 }, + .Version = TVersion{ .Year = 1, .Major = 2, .Minor = 2, .Patch = 4, .Hotfix = 0 }, .StoresReadableBy = { TCompatibilityRule{ .LowerLimit = TVersion{ .Year = 1, .Major = 1 }, - .UpperLimit = TVersion{ .Year = 1, .Major = 2, .Minor = 1 }, + .UpperLimit = TVersion{ .Year = 1, .Major = 2, .Minor = 1, .Patch = 4 }, .Forbidden = true } } @@ -233,17 +233,17 @@ Y_UNIT_TEST_SUITE(YdbVersion) { Test( TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 3, .Minor = 1, .Hotfix = 0 }, + .Version = TVersion{ .Year = 1, .Major = 3, .Minor = 1, .Patch = 1, .Hotfix = 0 }, .CanLoadFrom = { TCompatibilityRule{ .LowerLimit = TVersion{ .Year = 1, .Major = 1 }, - .UpperLimit = TVersion{ .Year = 1, .Major = 3, .Minor = 1, .Hotfix = 0 } + .UpperLimit = TVersion{ .Year = 1, .Major = 3, .Minor = 1, .Patch = 1, .Hotfix = 0 } } } }, TCurrentCompatibilityInfo{ .Application = "nbs", - .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 3, .Hotfix = 1 } + .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 3, .Patch = 1, .Hotfix = 1 } }, true ); @@ -252,16 +252,16 @@ Y_UNIT_TEST_SUITE(YdbVersion) { Test( TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 2, .Major = 4, .Minor = 1, .Hotfix = 0 }, + .Version = TVersion{ .Year = 2, .Major = 4, .Minor = 1, .Patch = 1, .Hotfix = 0 }, .CanLoadFrom = { TCompatibilityRule{ - .UpperLimit = TVersion{ .Year = 2, .Major = 4, .Minor = 1, .Hotfix = 0 } + .UpperLimit = TVersion{ .Year = 2, .Major = 4, .Minor = 1, .Patch = 1, .Hotfix = 0 } } } }, TCurrentCompatibilityInfo{ .Application = "nbs", - .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 3, .Hotfix = 1 } + .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 3, .Patch = 1, .Hotfix = 1 } }, true ); @@ -270,17 +270,17 @@ Y_UNIT_TEST_SUITE(YdbVersion) { Test( TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 3, .Minor = 1, .Hotfix = 0 }, + .Version = TVersion{ .Year = 1, .Major = 3, .Minor = 1, .Patch = 1, .Hotfix = 0 }, .CanLoadFrom = { TCompatibilityRule{ .LowerLimit = TVersion{ .Year = 1, .Major = 2 }, - .UpperLimit = TVersion{ .Year = 1, .Major = 3, .Minor = 1, .Hotfix = 0 } + .UpperLimit = TVersion{ .Year = 1, .Major = 3, .Minor = 1, .Patch = 1, .Hotfix = 0 } } } }, TCurrentCompatibilityInfo{ .Application = "nbs", - .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 3, .Hotfix = 1 } + .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 3, .Patch = 3, .Hotfix = 1 } }, false ); @@ -289,17 +289,17 @@ Y_UNIT_TEST_SUITE(YdbVersion) { Test( TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 3, .Minor = 1, .Hotfix = 0 }, + .Version = TVersion{ .Year = 1, .Major = 3, .Minor = 1, .Patch = 1, .Hotfix = 0 }, .StoresReadableBy = { TCompatibilityRule{ .LowerLimit = TVersion{ .Year = 1, .Major = 1 }, - .UpperLimit = TVersion{ .Year = 1, .Major = 3, .Minor = 1, .Hotfix = 0 } + .UpperLimit = TVersion{ .Year = 1, .Major = 3, .Minor = 1, .Patch = 1, .Hotfix = 0 } } } }, TCurrentCompatibilityInfo{ .Application = "nbs", - .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 3, .Hotfix = 1 } + .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 3, .Patch = 1, .Hotfix = 1 } }, false ); @@ -308,15 +308,15 @@ Y_UNIT_TEST_SUITE(YdbVersion) { Test( TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 2, .Hotfix = 0 } + .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 2, .Patch = 1, .Hotfix = 0 } }, TCurrentCompatibilityInfo{ .Application = "nbs", - .Version = TVersion{ .Year = 1, .Major = 3, .Minor = 3, .Hotfix = 1 }, + .Version = TVersion{ .Year = 1, .Major = 3, .Minor = 3, .Patch = 1, .Hotfix = 1 }, .StoresReadableBy = { TCompatibilityRule{ .LowerLimit = TVersion{ .Year = 1, .Major = 1 }, - .UpperLimit = TVersion{ .Year = 1, .Major = 3, .Minor = 3, .Hotfix = 1 } + .UpperLimit = TVersion{ .Year = 1, .Major = 3, .Minor = 3, .Patch = 1, .Hotfix = 1 } } } }, @@ -327,15 +327,15 @@ Y_UNIT_TEST_SUITE(YdbVersion) { Test( TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 2, .Hotfix = 0 } + .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 2, .Patch = 1, .Hotfix = 0 } }, TCurrentCompatibilityInfo{ .Application = "nbs", - .Version = TVersion{ .Year = 1, .Major = 3, .Minor = 3, .Hotfix = 1 }, + .Version = TVersion{ .Year = 1, .Major = 3, .Minor = 3, .Patch = 1, .Hotfix = 1 }, .StoresReadableBy = { TCompatibilityRule{ - .LowerLimit = TVersion{ .Year = 1, .Major = 1, .Minor = 3, .Hotfix = 1 }, - .UpperLimit = TVersion{ .Year = 1, .Major = 3, .Minor = 3, .Hotfix = 1 } + .LowerLimit = TVersion{ .Year = 1, .Major = 1, .Minor = 3, .Patch = 1, .Hotfix = 1 }, + .UpperLimit = TVersion{ .Year = 1, .Major = 3, .Minor = 3, .Patch = 1, .Hotfix = 1 } } } }, @@ -346,15 +346,15 @@ Y_UNIT_TEST_SUITE(YdbVersion) { Test( TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 4, .Minor = 1, .Hotfix = 0 } + .Version = TVersion{ .Year = 1, .Major = 4, .Minor = 1, .Patch = 1, .Hotfix = 0 } }, TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 3, .Minor = 3, .Hotfix = 1 }, + .Version = TVersion{ .Year = 1, .Major = 3, .Minor = 3, .Patch = 1, .Hotfix = 1 }, .StoresReadableBy = { TCompatibilityRule{ - .LowerLimit = TVersion{ .Year = 1, .Major = 1, .Minor = 3 }, - .UpperLimit = TVersion{ .Year = 1, .Major = 3, .Minor = 3, .Hotfix = 1 } + .LowerLimit = TVersion{ .Year = 1, .Major = 1, .Minor = 3, .Patch = 1 }, + .UpperLimit = TVersion{ .Year = 1, .Major = 3, .Minor = 3, .Patch = 1, .Hotfix = 1 } } } }, @@ -365,15 +365,15 @@ Y_UNIT_TEST_SUITE(YdbVersion) { Test( TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 5, .Minor = 1, .Hotfix = 0 } + .Version = TVersion{ .Year = 1, .Major = 5, .Minor = 1, .Patch = 1, .Hotfix = 0 } }, TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 3, .Minor = 3, .Hotfix = 1 }, + .Version = TVersion{ .Year = 1, .Major = 3, .Minor = 3, .Patch = 1, .Hotfix = 1 }, .StoresReadableBy = { TCompatibilityRule{ - .LowerLimit = TVersion{ .Year = 1, .Major = 1, .Minor = 3 }, - .UpperLimit = TVersion{ .Year = 1, .Major = 3, .Minor = 3, .Hotfix = 1 } + .LowerLimit = TVersion{ .Year = 1, .Major = 1, .Minor = 3, .Patch = 1 }, + .UpperLimit = TVersion{ .Year = 1, .Major = 3, .Minor = 3, .Patch = 1, .Hotfix = 1 } } } }, @@ -384,16 +384,16 @@ Y_UNIT_TEST_SUITE(YdbVersion) { Test( TCurrentCompatibilityInfo{ .Application = "nbs", - .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 2, .Hotfix = 0 } + .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 2, .Patch = 1, .Hotfix = 0 } }, TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 3, .Minor = 3, .Hotfix = 1 }, + .Version = TVersion{ .Year = 1, .Major = 3, .Minor = 3, .Patch = 1, .Hotfix = 1 }, .CanConnectTo = { TCompatibilityRule{ .Application = "nbs", .LowerLimit = TVersion{ .Year = 1, .Major = 1 }, - .UpperLimit = TVersion{ .Year = 1, .Major = 3, .Minor = 3, .Hotfix = 1 }, + .UpperLimit = TVersion{ .Year = 1, .Major = 3, .Minor = 3, .Patch = 1, .Hotfix = 1 }, .ComponentId = EComponentId::Interconnect, } } @@ -406,16 +406,16 @@ Y_UNIT_TEST_SUITE(YdbVersion) { Test( TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 2, .Hotfix = 0 } + .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 2, .Patch = 1, .Hotfix = 0 } }, TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 3, .Minor = 3, .Hotfix = 1 }, + .Version = TVersion{ .Year = 1, .Major = 3, .Minor = 3, .Patch = 1, .Hotfix = 1 }, .CanConnectTo = { TCompatibilityRule{ .Application = "nbs", .LowerLimit = TVersion{ .Year = 1, .Major = 1 }, - .UpperLimit = TVersion{ .Year = 1, .Major = 3, .Minor = 3, .Hotfix = 1 }, + .UpperLimit = TVersion{ .Year = 1, .Major = 3, .Minor = 3, .Patch = 1, .Hotfix = 1 }, .ComponentId = EComponentId::Interconnect, } } @@ -428,19 +428,19 @@ Y_UNIT_TEST_SUITE(YdbVersion) { Test( TCurrentCompatibilityInfo{ .Application = "nbs", - .Version = TVersion{ .Year = 1, .Major = 3, .Minor = 2, .Hotfix = 0 }, + .Version = TVersion{ .Year = 1, .Major = 3, .Minor = 2, .Patch = 1, .Hotfix = 0 }, .CanConnectTo = { TCompatibilityRule{ .Application = "ydb", .LowerLimit = TVersion{ .Year = 1, .Major = 1 }, - .UpperLimit = TVersion{ .Year = 1, .Major = 3, .Minor = 2, .Hotfix = 0 }, + .UpperLimit = TVersion{ .Year = 1, .Major = 3, .Minor = 2, .Patch = 1, .Hotfix = 0 }, .ComponentId = EComponentId::Interconnect, } } }, TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 3, .Hotfix = 2 }, + .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 3, .Patch = 1, .Hotfix = 2 }, }, true, EComponentId::Interconnect @@ -450,19 +450,19 @@ Y_UNIT_TEST_SUITE(YdbVersion) { Test( TCurrentCompatibilityInfo{ .Application = "nbs", - .Version = TVersion{ .Year = 1, .Major = 3, .Minor = 2, .Hotfix = 0 }, + .Version = TVersion{ .Year = 1, .Major = 3, .Minor = 2, .Patch = 1, .Hotfix = 0 }, .CanConnectTo = { TCompatibilityRule{ .Application = "ydb", .LowerLimit = TVersion{ .Year = 1, .Major = 1 }, - .UpperLimit = TVersion{ .Year = 1, .Major = 3, .Minor = 2, .Hotfix = 0 }, + .UpperLimit = TVersion{ .Year = 1, .Major = 3, .Minor = 2, .Patch = 1, .Hotfix = 0 }, .ComponentId = EComponentId::Interconnect, } } }, TCurrentCompatibilityInfo{ .Application = "nbs", - .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 3, .Hotfix = 2 }, + .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 3, .Patch = 1, .Hotfix = 2 }, }, false ); @@ -471,17 +471,17 @@ Y_UNIT_TEST_SUITE(YdbVersion) { Test( TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 3, .Minor = 2, .Hotfix = 0 }, + .Version = TVersion{ .Year = 1, .Major = 3, .Minor = 2, .Patch = 1, .Hotfix = 0 }, .CanLoadFrom = { TCompatibilityRule{ - .LowerLimit = TVersion{ .Year = 1, .Major = 1, .Minor = 3, .Hotfix = 2 }, - .UpperLimit = TVersion{ .Year = 1, .Major = 1, .Minor = 3, .Hotfix = 2 } + .LowerLimit = TVersion{ .Year = 1, .Major = 1, .Minor = 3, .Patch = 1, .Hotfix = 2 }, + .UpperLimit = TVersion{ .Year = 1, .Major = 1, .Minor = 3, .Patch = 1, .Hotfix = 2 } } } }, TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 3, .Hotfix = 2 }, + .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 3, .Patch = 1, .Hotfix = 2 }, }, true ); @@ -490,18 +490,18 @@ Y_UNIT_TEST_SUITE(YdbVersion) { Test( TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 2, .Minor = 2, .Hotfix = 0 }, + .Version = TVersion{ .Year = 1, .Major = 2, .Minor = 2, .Patch = 1, .Hotfix = 0 }, .CanLoadFrom = { TCompatibilityRule{ - .LowerLimit = TVersion{ .Year = 1, .Major = 1, .Minor = 3 }, - .UpperLimit = TVersion{ .Year = 1, .Major = 1, .Minor = 3 }, + .LowerLimit = TVersion{ .Year = 1, .Major = 1, .Minor = 3, .Patch = 1 }, + .UpperLimit = TVersion{ .Year = 1, .Major = 1, .Minor = 3, .Patch = 1 }, .Forbidden = true } } }, TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 3, .Hotfix = 1 }, + .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 3, .Patch = 1, .Hotfix = 1 }, }, false ); @@ -510,18 +510,18 @@ Y_UNIT_TEST_SUITE(YdbVersion) { Test( TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 2, .Minor = 2, .Hotfix = 0 }, + .Version = TVersion{ .Year = 1, .Major = 2, .Minor = 2, .Patch = 1, .Hotfix = 0 }, .CanLoadFrom = { TCompatibilityRule{ - .LowerLimit = TVersion{ .Year = 1, .Major = 1, .Minor = 3 }, - .UpperLimit = TVersion{ .Year = 1, .Major = 1, .Minor = 3 }, + .LowerLimit = TVersion{ .Year = 1, .Major = 1, .Minor = 3, .Patch = 1 }, + .UpperLimit = TVersion{ .Year = 1, .Major = 1, .Minor = 3, .Patch = 1 }, .Forbidden = true } } }, TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 4 }, + .Version = TVersion{ .Year = 1, .Major = 1, .Minor = 4, .Patch = 1 }, }, true ); @@ -530,22 +530,22 @@ Y_UNIT_TEST_SUITE(YdbVersion) { Test( TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 4, .Minor = 2, .Hotfix = 0 }, + .Version = TVersion{ .Year = 1, .Major = 4, .Minor = 2, .Patch = 1, .Hotfix = 0 }, .CanLoadFrom = { TCompatibilityRule{ .LowerLimit = TVersion{ .Year = 1, .Major = 1 }, - .UpperLimit = TVersion{ .Year = 1, .Major = 4, .Minor = 2, .Hotfix = 0 }, + .UpperLimit = TVersion{ .Year = 1, .Major = 4, .Minor = 2, .Patch = 1, .Hotfix = 0 }, }, TCompatibilityRule{ - .LowerLimit = TVersion{ .Year = 1, .Major = 2, .Minor = 3 }, - .UpperLimit = TVersion{ .Year = 1, .Major = 2, .Minor = 3 }, + .LowerLimit = TVersion{ .Year = 1, .Major = 2, .Minor = 3, .Patch = 1 }, + .UpperLimit = TVersion{ .Year = 1, .Major = 2, .Minor = 3, .Patch = 1 }, .Forbidden = true } } }, TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 2, .Minor = 3, .Hotfix = 0 }, + .Version = TVersion{ .Year = 1, .Major = 2, .Minor = 3, .Patch = 1, .Hotfix = 0 }, }, false ); @@ -554,22 +554,22 @@ Y_UNIT_TEST_SUITE(YdbVersion) { Test( TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 4, .Minor = 2, .Hotfix = 0 }, + .Version = TVersion{ .Year = 1, .Major = 4, .Minor = 2, .Patch = 1, .Hotfix = 0 }, .CanLoadFrom = { TCompatibilityRule{ .LowerLimit = TVersion{ .Year = 1, .Major = 1 }, - .UpperLimit = TVersion{ .Year = 1, .Major = 4, .Minor = 2, .Hotfix = 0 }, + .UpperLimit = TVersion{ .Year = 1, .Major = 4, .Minor = 2, .Patch = 1, .Hotfix = 0 }, }, TCompatibilityRule{ - .LowerLimit = TVersion{ .Year = 1, .Major = 2, .Minor = 4 }, - .UpperLimit = TVersion{ .Year = 1, .Major = 2, .Minor = 4 }, + .LowerLimit = TVersion{ .Year = 1, .Major = 2, .Minor = 4, .Patch = 1 }, + .UpperLimit = TVersion{ .Year = 1, .Major = 2, .Minor = 4, .Patch = 1 }, .Forbidden = true } } }, TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 2, .Minor = 3, .Hotfix = 0 }, + .Version = TVersion{ .Year = 1, .Major = 2, .Minor = 3, .Patch = 1, .Hotfix = 0 }, }, true ); @@ -578,18 +578,18 @@ Y_UNIT_TEST_SUITE(YdbVersion) { Test( TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 4, .Minor = 2, .Hotfix = 0 }, + .Version = TVersion{ .Year = 1, .Major = 4, .Minor = 2, .Patch = 1, .Hotfix = 0 }, .CanLoadFrom = { TCompatibilityRule{ .LowerLimit = TVersion{ .Year = 1, .Major = 1 }, - .UpperLimit = TVersion{ .Year = 1, .Major = 4, .Minor = 2, .Hotfix = 0 }, + .UpperLimit = TVersion{ .Year = 1, .Major = 4, .Minor = 2, .Patch = 1, .Hotfix = 0 }, .ComponentId = (ui32)EComponentId::Test1, }, } }, TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 2, .Minor = 3, .Hotfix = 0 }, + .Version = TVersion{ .Year = 1, .Major = 2, .Minor = 3, .Patch = 1, .Hotfix = 0 }, }, true ); @@ -598,18 +598,18 @@ Y_UNIT_TEST_SUITE(YdbVersion) { Test( TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 4, .Minor = 2, .Hotfix = 0 }, + .Version = TVersion{ .Year = 1, .Major = 4, .Minor = 2, .Patch = 1, .Hotfix = 0 }, .CanLoadFrom = { TCompatibilityRule{ .LowerLimit = TVersion{ .Year = 1, .Major = 1 }, - .UpperLimit = TVersion{ .Year = 1, .Major = 4, .Minor = 2, .Hotfix = 0 }, + .UpperLimit = TVersion{ .Year = 1, .Major = 4, .Minor = 2, .Patch = 1, .Hotfix = 0 }, .ComponentId = (ui32)EComponentId::Test2, }, } }, TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 1, .Major = 2, .Minor = 3, .Hotfix = 0 }, + .Version = TVersion{ .Year = 1, .Major = 2, .Minor = 3, .Patch = 1, .Hotfix = 0 }, }, false ); @@ -619,11 +619,11 @@ Y_UNIT_TEST_SUITE(YdbVersion) { Test( TCurrentCompatibilityInfo{ .Application = "nbs", - .Version = TVersion{ .Year = 23, .Major = 3, .Minor = 2, .Hotfix = 0 }, + .Version = TVersion{ .Year = 23, .Major = 3, .Minor = 2, .Patch = 1, .Hotfix = 0 }, }, TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 24, .Major = 2, .Minor = 3, .Hotfix = 0 }, + .Version = TVersion{ .Year = 24, .Major = 2, .Minor = 3, .Patch = 1, .Hotfix = 0 }, .CanConnectTo = { TCompatibilityRule{ .Application = "nbs", @@ -642,7 +642,7 @@ Y_UNIT_TEST_SUITE(YdbVersion) { Test( TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 24, .Major = 3, .Minor = 1, .Hotfix = 0 }, + .Version = TVersion{ .Year = 24, .Major = 3, .Minor = 1, .Patch = 1, .Hotfix = 0 }, .CanLoadFrom = { TCompatibilityRule{ .Application = "nbs", @@ -660,7 +660,7 @@ Y_UNIT_TEST_SUITE(YdbVersion) { }, TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 24, .Major = 2, .Minor = 3, .Hotfix = 0 }, + .Version = TVersion{ .Year = 24, .Major = 2, .Minor = 3, .Patch = 1, .Hotfix = 0 }, .CanLoadFrom = { TCompatibilityRule{ .Application = "nbs", @@ -680,6 +680,69 @@ Y_UNIT_TEST_SUITE(YdbVersion) { ); } + Y_UNIT_TEST(WithPatchAndWithoutPatch) { + Test( + TCurrentCompatibilityInfo{ + .Application = "ydb", + .Version = TVersion{ .Year = 25, .Major = 1, .Minor = 1, .Patch = 1, .Hotfix = 0 }, + }, + TCurrentCompatibilityInfo{ + .Application = "ydb", + .Version = TVersion{ .Year = 24, .Major = 3, .Minor = 1, .Patch = 1, .Hotfix = 0 }, + }, + false + ); + } + + Y_UNIT_TEST(AcceptSpecificHotfixWithoutPatch) { + Test( + TCurrentCompatibilityInfo{ + .Application = "ydb", + .Version = TVersion{ .Year = 25, .Major = 1, .Minor = 7, .Patch = 1, .Hotfix = 0 }, + .CanLoadFrom = { + TCompatibilityRule{ + .LowerLimit = TVersion{ .Year = 24, .Major = 4, .Minor = 1, .Hotfix = 3 }, + .UpperLimit = TVersion{ .Year = 24, .Major = 4, .Minor = 1, .Hotfix = 3 }, + }, + }, + .StoresReadableBy = { + TCompatibilityRule{ + .LowerLimit = TVersion{ .Year = 24, .Major = 4, .Minor = 1, .Hotfix = 3 }, + .UpperLimit = TVersion{ .Year = 24, .Major = 4, .Minor = 1, .Hotfix = 3 }, + }, + } + }, + TCurrentCompatibilityInfo{ + .Application = "ydb", + .Version = TVersion{ .Year = 24, .Major = 4, .Minor = 1, .Hotfix = 3 }, + }, + true + ); + Test( + TCurrentCompatibilityInfo{ + .Application = "ydb", + .Version = TVersion{ .Year = 25, .Major = 1, .Minor = 7, .Patch = 1, .Hotfix = 0 }, + .CanLoadFrom = { + TCompatibilityRule{ + .LowerLimit = TVersion{ .Year = 24, .Major = 4, .Minor = 1, .Hotfix = 3 }, + .UpperLimit = TVersion{ .Year = 24, .Major = 4, .Minor = 1, .Hotfix = 3 }, + }, + }, + .StoresReadableBy = { + TCompatibilityRule{ + .LowerLimit = TVersion{ .Year = 24, .Major = 4, .Minor = 1, .Hotfix = 3 }, + .UpperLimit = TVersion{ .Year = 24, .Major = 4, .Minor = 1, .Hotfix = 3 }, + }, + } + }, + TCurrentCompatibilityInfo{ + .Application = "ydb", + .Version = TVersion{ .Year = 24, .Major = 4, .Minor = 1, .Hotfix = 2 }, + }, + false + ); + } + Y_UNIT_TEST(TrunkYDBAndNbs) { Test( TCurrentCompatibilityInfo{ @@ -692,6 +755,7 @@ Y_UNIT_TEST_SUITE(YdbVersion) { EComponentId::Interconnect ); } + Y_UNIT_TEST(TrunkAndStable) { Test( TCurrentCompatibilityInfo{ @@ -699,7 +763,7 @@ Y_UNIT_TEST_SUITE(YdbVersion) { }, TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 24, .Major = 3, .Minor = 1, .Hotfix = 0 }, + .Version = TVersion{ .Year = 24, .Major = 3, .Minor = 1, .Patch = 1, .Hotfix = 0 }, }, false ); @@ -760,11 +824,21 @@ Y_UNIT_TEST_SUITE(YdbVersion) { ); } + Y_UNIT_TEST(PrintStableWithPatch) { + PrintCompatibilityInfo( + TCurrentCompatibilityInfo{ + .Application = "ydb", + .Version = TVersion{ .Year = 25, .Major = 1, .Minor = 4, .Patch = 1, .Hotfix = 4 }, + }.ToPB(), + EPrintAs::HumanReadable + ); + } + Y_UNIT_TEST(PrintYdbAndNbs) { PrintCompatibilityInfo( TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 24, .Major = 2, .Minor = 2, .Hotfix = 0 }, + .Version = TVersion{ .Year = 24, .Major = 2, .Minor = 2, .Patch = 1, .Hotfix = 0 }, .CanConnectTo = { TCompatibilityRule{ .Application = "nbs", @@ -782,12 +856,12 @@ Y_UNIT_TEST_SUITE(YdbVersion) { PrintCompatibilityInfo( TCurrentCompatibilityInfo{ .Application = "ydb", - .Version = TVersion{ .Year = 23, .Major = 4, .Minor = 5, .Hotfix = 1 }, + .Version = TVersion{ .Year = 23, .Major = 4, .Minor = 5, .Patch = 1, .Hotfix = 1 }, .StoresReadableBy = { TCompatibilityRule{ .Application = "ydb", - .LowerLimit = TVersion{ .Year = 23, .Major = 4, .Minor = 5, .Hotfix = 0 }, - .UpperLimit = TVersion{ .Year = 23, .Major = 4, .Minor = 5, .Hotfix = 0 }, + .LowerLimit = TVersion{ .Year = 23, .Major = 4, .Minor = 5, .Patch = 1, .Hotfix = 0 }, + .UpperLimit = TVersion{ .Year = 23, .Major = 4, .Minor = 5, .Patch = 1, .Hotfix = 0 }, .ComponentId = EComponentId::PDisk, .Forbidden = true, }, diff --git a/ydb/core/driver_lib/version/version.cpp b/ydb/core/driver_lib/version/version.cpp index 18626c0aa808..7bc6ccc13f1b 100644 --- a/ydb/core/driver_lib/version/version.cpp +++ b/ydb/core/driver_lib/version/version.cpp @@ -156,16 +156,21 @@ TStored TCompatibilityInfo::MakeStored(TComponentId componentId) const { //////////////////////////////////////////////////////////////////////////////////////// // YDB versions are compared alphabetically, much like strings, -// but instead of chars there are 4 componets: Year, Major, Minor and Hotfix +// but instead of chars there are 5 componets: +// Year, Major, Minor, Patch and Hotfix // Each of the version's components can be absent // If one is, than all the following components are also considered to be 'absent' +// Patch component was introduced in a 25.1 Major update, so we don't have specific +// rules to compare versions with and without Patch, all versions without Patch (<=24.4) +// are < than versions with Patch (>=25.1) // Absent component is equal to any other, including other absent // // Some examples: -// 22.1.1.1 < 22.1.2.0 -// 22.2.1.0 > 22.1._._ -// 23.1._._ == 23.1.1.0 -// +// 25.1.1.1.1 < 26.1.2.1.0 +// 22.2.1.0.1 > 22.1._._._ +// 23.1._._._ == 23.1.1.0.1 +// + // Function returns -1 if left < right, 0 if left == right, 1 if left > right i32 CompareVersions(const NKikimrConfig::TYdbVersion& left, const NKikimrConfig::TYdbVersion& right) { if (!left.HasYear() || !right.HasYear()) { @@ -195,6 +200,17 @@ i32 CompareVersions(const NKikimrConfig::TYdbVersion& left, const NKikimrConfig: return 1; } + if (left.HasPatch() ^ right.HasPatch()) { + // one version has Patch component, other doesn't + return 0; + } else if (left.HasPatch() && right.HasPatch()) { + if (left.GetPatch() < right.GetPatch()) { + return -1; + } else if (left.GetPatch() > right.GetPatch()) { + return 1; + } + } + if (!left.HasHotfix() || !right.HasHotfix()) { return 0; } @@ -208,6 +224,7 @@ i32 CompareVersions(const NKikimrConfig::TYdbVersion& left, const NKikimrConfig: } bool IsVersionComplete(const NKikimrConfig::TYdbVersion& version) { + // Patch component was introduced later, so version can be complete without it return version.HasYear() && version.HasMajor() && version.HasMinor() && version.HasHotfix(); } @@ -424,6 +441,18 @@ std::optional ParseVersionFromTag(TString tag, TStri parts.pop_front(); version.SetMinor(minor); + // parse Patch number + // We don't need to parse versions without Patch component, since this + // code only present in newer trunks and stables >=25.1, where Patch is + // already introduced, and only used to parse local + ui32 patch; + if (!TryIntFromString<10, ui32>(parts.front(), patch)) { + // example: stable-25-1-1-prestablle == 25.1.1 + return version; + } + parts.pop_front(); + version.SetPatch(patch); + // parse Hotfix ui32 hotfix; if (parts.empty()) { @@ -509,9 +538,9 @@ bool TCompatibilityInfo::CompleteFromTag(NKikimrConfig::TCurrentCompatibilityInf TString tag = GetTagString(); for (TString delim : {"-", "."}) { - auto tryParse = ParseVersionFromTag(tag, delim); + std::optional tryParse = ParseVersionFromTag(tag, delim); if (tryParse) { - auto versionFromTag = *tryParse; + NKikimrConfig::TYdbVersion versionFromTag = *tryParse; auto version = current.MutableVersion(); if (version->HasYear()) { Y_ABORT_UNLESS(version->GetYear() == versionFromTag.GetYear()); @@ -533,6 +562,14 @@ bool TCompatibilityInfo::CompleteFromTag(NKikimrConfig::TCurrentCompatibilityInf } } + if (versionFromTag.HasPatch()) { + if (version->HasPatch()) { + Y_ABORT_UNLESS(version->GetPatch() == versionFromTag.GetPatch()); + } else { + version->SetPatch(versionFromTag.GetPatch()); + } + } + if (versionFromTag.HasHotfix()) { if (version->HasHotfix()) { Y_ABORT_UNLESS(version->GetHotfix() == versionFromTag.GetHotfix()); @@ -663,6 +700,13 @@ void PrintVersion(IOutputStream& out, const NKikimrConfig::TYdbVersion& version, return; } + if (version.HasPatch()) { + out << "-" << version.GetPatch(); + } else if (printSuffix) { + out << "-*"; + return; + } + if (version.HasHotfix()) { const ui32 hotfix = version.GetHotfix(); if (hotfix == 1) { diff --git a/ydb/core/driver_lib/version/version.h b/ydb/core/driver_lib/version/version.h index a18b2ad0cb5b..40d90a91e8a1 100644 --- a/ydb/core/driver_lib/version/version.h +++ b/ydb/core/driver_lib/version/version.h @@ -20,6 +20,7 @@ class TCompatibilityInfo { std::optional Year; std::optional Major; std::optional Minor; + std::optional Patch; std::optional Hotfix; NKikimrConfig::TYdbVersion ToPB() { @@ -33,6 +34,9 @@ class TCompatibilityInfo { if (Minor) { res.SetMinor(*Minor); } + if (Patch) { + res.SetPatch(*Patch); + } if (Hotfix) { res.SetHotfix(*Hotfix); } diff --git a/ydb/core/protos/config.proto b/ydb/core/protos/config.proto index 0d60cf6f7909..f7e9cd1b6be1 100644 --- a/ydb/core/protos/config.proto +++ b/ydb/core/protos/config.proto @@ -2324,6 +2324,7 @@ message TYdbVersion { optional uint32 Year = 1; optional uint32 Major = 2; optional uint32 Minor = 3; + optional uint32 Patch = 5; optional uint32 Hotfix = 4; }