@@ -936,21 +936,23 @@ class TAlterExtSubDomain: public TSubOperation {
936
936
// Create or derive alter.
937
937
// (We could have always created new alter from a current subdomainInfo but
938
938
// we need to take into account possible version increase from CreateHive suboperation.)
939
- auto createAlterFrom = [&inputSettings, &delta ](auto prototype) {
939
+ auto createAlterFrom = [&inputSettings](auto prototype, const TStoragePools& additionalPools ) {
940
940
return MakeIntrusive<TSubDomainInfo>(
941
941
*prototype,
942
942
inputSettings.GetPlanResolution (),
943
943
inputSettings.GetTimeCastBucketsPerMediator (),
944
- delta. StoragePoolsAdded
944
+ additionalPools
945
945
);
946
946
};
947
947
TSubDomainInfo::TPtr alter = [&delta, &subdomainInfo, &createAlterFrom, &context]() {
948
948
if (delta.AddExternalHive && context.SS ->EnableAlterDatabaseCreateHiveFirst ) {
949
949
Y_ABORT_UNLESS (subdomainInfo->GetAlter ());
950
- return createAlterFrom (subdomainInfo->GetAlter ());
950
+ // NOTE: existing alter already has all storage pools that combined operation wanted to add,
951
+ // should not add them second time when deriving alter from alter
952
+ return createAlterFrom (subdomainInfo->GetAlter (), {});
951
953
} else {
952
954
Y_ABORT_UNLESS (!subdomainInfo->GetAlter ());
953
- return createAlterFrom (subdomainInfo);
955
+ return createAlterFrom (subdomainInfo, delta. StoragePoolsAdded );
954
956
}
955
957
}();
956
958
0 commit comments