Browse Source

Fix bug KIKIMR-14912

ref:8a30a2fd4f1173a26501c7891bfd85175753f9b5
Alexander Rutkovsky 2 years ago
parent
commit
07586ceb54

+ 7 - 2
ydb/core/mind/bscontroller/config_fit_pdisks.cpp

@@ -16,6 +16,11 @@ namespace NKikimr {
             return pdiskId;
         }
 
+        static TString FormatPDiskConfig(const TString& s) {
+            NKikimrBlobStorage::TPDiskConfig proto;
+            return proto.ParseFromString(s) ? SingleLineProto(proto) : "<error>";
+        }
+
         Schema::PDisk::Guid::Type TBlobStorageController::CheckStaticPDisk(TConfigState &state, TPDiskId pdiskId,
                 const TPDiskCategory& category, const TMaybe<Schema::PDisk::PDiskConfig::Type>& pdiskConfig,
                 ui32 *staticSlotUsage) {
@@ -31,8 +36,8 @@ namespace NKikimr {
             // validate fields
             if (pdiskConfig.GetOrElse(TString()) != info.PDiskConfig) {
                 throw TExError() << "PDiskConfig field doesn't match static one"
-                    << " pdiskConfig# " << (pdiskConfig ? *pdiskConfig : "(empty)")
-                    << " info.PDiskConfig# " << info.PDiskConfig;
+                    << " pdiskConfig# " << (pdiskConfig ? FormatPDiskConfig(*pdiskConfig) : "(empty)")
+                    << " info.PDiskConfig# " << FormatPDiskConfig(info.PDiskConfig);
             } else if (category != info.Category) {
                 throw TExError() << "Type/Kind fields do not match static one";
             }

+ 1 - 0
ydb/core/mind/bscontroller/defs.h

@@ -29,6 +29,7 @@
 #include <ydb/core/tablet/tablet_counters_protobuf.h>
 #include <ydb/core/tablet/tablet_metrics.h>
 #include <ydb/core/tablet/tablet_responsiveness_pinger.h>
+#include <ydb/core/util/pb.h>
 #include <ydb/core/util/format.h>
 #include <ydb/core/util/stlog.h>
 #include <library/cpp/actors/core/actor_bootstrapped.h>