From 92e0339ff5e763626299b057a5a5c1e2e294fda9 Mon Sep 17 00:00:00 2001 From: JaySon-Huang Date: Tue, 21 Mar 2023 16:37:53 +0800 Subject: [PATCH 1/8] Add a config flash.use_autoscaler_without_s3 Signed-off-by: JaySon-Huang --- dbms/src/Core/TiFlashDisaggregatedMode.cpp | 15 ++++++++++++++- dbms/src/Core/TiFlashDisaggregatedMode.h | 1 + dbms/src/Server/Server.cpp | 8 ++++++-- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/dbms/src/Core/TiFlashDisaggregatedMode.cpp b/dbms/src/Core/TiFlashDisaggregatedMode.cpp index 856d62e3ca2..f648b26c54a 100644 --- a/dbms/src/Core/TiFlashDisaggregatedMode.cpp +++ b/dbms/src/Core/TiFlashDisaggregatedMode.cpp @@ -14,6 +14,7 @@ #include #include +#include "Poco/Util/LayeredConfiguration.h" namespace DB { @@ -43,7 +44,6 @@ DisaggregatedMode getDisaggregatedMode(const Poco::Util::LayeredConfiguration & return mode; } -// todo: remove this after AutoScaler is stable. bool useAutoScaler(const Poco::Util::LayeredConfiguration & config) { static const std::string autoscaler_config_key = "flash.use_autoscaler"; @@ -53,6 +53,19 @@ bool useAutoScaler(const Poco::Util::LayeredConfiguration & config) return use_autoscaler; } +// Use auto scaler without S3 disagg // TODO: remove it after S3 disagg is stable +bool useAutoScalerWithoutS3(const Poco::Util::LayeredConfiguration & config) +{ + // Keep the behavior running disagg without S3 when auto scaler is enable. + // This is a special config that is only effecive when `flash.use_autoscaler` + // is true. Will be removed soon. + static const std::string autoscaler_config_key = "flash.use_autoscaler_without_s3"; + bool use_autoscaler_without_s3 = false; + if (config.has(autoscaler_config_key)) + use_autoscaler_without_s3 = config.getBool(autoscaler_config_key); + return use_autoscaler_without_s3; +} + std::string getProxyLabelByDisaggregatedMode(DisaggregatedMode mode) { switch (mode) diff --git a/dbms/src/Core/TiFlashDisaggregatedMode.h b/dbms/src/Core/TiFlashDisaggregatedMode.h index 5e12ff38cd3..143a1f73e0b 100644 --- a/dbms/src/Core/TiFlashDisaggregatedMode.h +++ b/dbms/src/Core/TiFlashDisaggregatedMode.h @@ -39,5 +39,6 @@ enum class DisaggregatedMode DisaggregatedMode getDisaggregatedMode(const Poco::Util::LayeredConfiguration & config); bool useAutoScaler(const Poco::Util::LayeredConfiguration & config); +bool useAutoScalerWithoutS3(const Poco::Util::LayeredConfiguration & config); std::string getProxyLabelByDisaggregatedMode(DisaggregatedMode mode); } // namespace DB diff --git a/dbms/src/Server/Server.cpp b/dbms/src/Server/Server.cpp index aedaaac4380..c7d63e52f17 100644 --- a/dbms/src/Server/Server.cpp +++ b/dbms/src/Server/Server.cpp @@ -957,6 +957,7 @@ int Server::main(const std::vector & /*args*/) const auto disaggregated_mode = getDisaggregatedMode(config()); const auto use_autoscaler = useAutoScaler(config()); + const bool use_autoscaler_without_s3 = useAutoScaler(config()); // Some Storage's config is necessary for Proxy TiFlashStorageConfig storage_config; @@ -971,8 +972,11 @@ int Server::main(const std::vector & /*args*/) } else if (disaggregated_mode == DisaggregatedMode::Compute && use_autoscaler) { - // compute node with auto scaler, the requirements will be initted later. - storage_config.s3_config.enable(/*check_requirements*/ false, log); + if (!use_autoscaler_without_s3) // Keep the behavior running disagg without S3 when auto scaler is enable. + { + // compute node with auto scaler, the requirements will be initted later. + storage_config.s3_config.enable(/*check_requirements*/ false, log); + } } if (storage_config.format_version != 0) From 6b731b768baeae281d1fccc34f220bb85c0d4d59 Mon Sep 17 00:00:00 2001 From: JaySon-Huang Date: Tue, 21 Mar 2023 16:42:22 +0800 Subject: [PATCH 2/8] Format files Signed-off-by: JaySon-Huang --- dbms/src/Core/TiFlashDisaggregatedMode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbms/src/Core/TiFlashDisaggregatedMode.cpp b/dbms/src/Core/TiFlashDisaggregatedMode.cpp index f648b26c54a..d167155cbb6 100644 --- a/dbms/src/Core/TiFlashDisaggregatedMode.cpp +++ b/dbms/src/Core/TiFlashDisaggregatedMode.cpp @@ -14,7 +14,7 @@ #include #include -#include "Poco/Util/LayeredConfiguration.h" +#include namespace DB { From 39cdafffb6f3f357cf5e4e3187e1d1dc997f75a2 Mon Sep 17 00:00:00 2001 From: JaySon-Huang Date: Tue, 21 Mar 2023 16:43:20 +0800 Subject: [PATCH 3/8] Fix Signed-off-by: JaySon-Huang --- dbms/src/Server/Server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbms/src/Server/Server.cpp b/dbms/src/Server/Server.cpp index c7d63e52f17..a77f255b36a 100644 --- a/dbms/src/Server/Server.cpp +++ b/dbms/src/Server/Server.cpp @@ -957,7 +957,7 @@ int Server::main(const std::vector & /*args*/) const auto disaggregated_mode = getDisaggregatedMode(config()); const auto use_autoscaler = useAutoScaler(config()); - const bool use_autoscaler_without_s3 = useAutoScaler(config()); + const bool use_autoscaler_without_s3 = useAutoScalerWithoutS3(config()); // Some Storage's config is necessary for Proxy TiFlashStorageConfig storage_config; From 3d58c170551d974c897231db160d4ec7f7a3ade1 Mon Sep 17 00:00:00 2001 From: JaySon-Huang Date: Tue, 21 Mar 2023 16:45:10 +0800 Subject: [PATCH 4/8] fix comment Signed-off-by: JaySon-Huang --- dbms/src/Server/Server.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dbms/src/Server/Server.cpp b/dbms/src/Server/Server.cpp index a77f255b36a..d20b63a43fa 100644 --- a/dbms/src/Server/Server.cpp +++ b/dbms/src/Server/Server.cpp @@ -972,11 +972,12 @@ int Server::main(const std::vector & /*args*/) } else if (disaggregated_mode == DisaggregatedMode::Compute && use_autoscaler) { - if (!use_autoscaler_without_s3) // Keep the behavior running disagg without S3 when auto scaler is enable. + if (!use_autoscaler_without_s3) { // compute node with auto scaler, the requirements will be initted later. storage_config.s3_config.enable(/*check_requirements*/ false, log); } + // else keep the behavior running disagg without S3 when auto scaler is enable. } if (storage_config.format_version != 0) From 75dbe9f6604503d6ae4ecb1208f95b427cbef1e6 Mon Sep 17 00:00:00 2001 From: JaySon-Huang Date: Tue, 21 Mar 2023 16:57:54 +0800 Subject: [PATCH 5/8] Format files Signed-off-by: JaySon-Huang --- dbms/src/Server/Server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbms/src/Server/Server.cpp b/dbms/src/Server/Server.cpp index d20b63a43fa..4efcb1eacc5 100644 --- a/dbms/src/Server/Server.cpp +++ b/dbms/src/Server/Server.cpp @@ -972,7 +972,7 @@ int Server::main(const std::vector & /*args*/) } else if (disaggregated_mode == DisaggregatedMode::Compute && use_autoscaler) { - if (!use_autoscaler_without_s3) + if (!use_autoscaler_without_s3) { // compute node with auto scaler, the requirements will be initted later. storage_config.s3_config.enable(/*check_requirements*/ false, log); From 81a677541a8ffb6f5387fc54deb00ce9105439f2 Mon Sep 17 00:00:00 2001 From: JaySon-Huang Date: Tue, 21 Mar 2023 22:17:25 +0800 Subject: [PATCH 6/8] Temporary disable async-grpc test Signed-off-by: JaySon-Huang --- tests/tidb-ci/run.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/tidb-ci/run.sh b/tests/tidb-ci/run.sh index bb7a5f5283d..60062c92236 100755 --- a/tests/tidb-ci/run.sh +++ b/tests/tidb-ci/run.sh @@ -33,9 +33,10 @@ docker-compose -f cluster.yaml -f tiflash-dt.yaml exec -T tiflash0 bash -c 'cd / docker-compose -f cluster.yaml -f tiflash-dt.yaml down clean_data_log -docker-compose -f cluster.yaml -f tiflash-dt-async-grpc.yaml up -d -wait_env -docker-compose -f cluster.yaml -f tiflash-dt-async-grpc.yaml exec -T tiflash0 bash -c 'cd /tests ; ./run-test.sh tidb-ci/async_grpc' +#TODO: Fix it https://github.com/pingcap/tiflash/issues/7120 +#docker-compose -f cluster.yaml -f tiflash-dt-async-grpc.yaml up -d +#wait_env +#docker-compose -f cluster.yaml -f tiflash-dt-async-grpc.yaml exec -T tiflash0 bash -c 'cd /tests ; ./run-test.sh tidb-ci/async_grpc' docker-compose -f cluster.yaml -f tiflash-dt-async-grpc.yaml down clean_data_log From 5e66160c19f316403397586e87590f929f1409f5 Mon Sep 17 00:00:00 2001 From: Zhigao Tong Date: Tue, 21 Mar 2023 22:28:22 +0800 Subject: [PATCH 7/8] Update MPPTunnelSetHelper.cpp --- dbms/src/Flash/Mpp/MPPTunnelSetHelper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbms/src/Flash/Mpp/MPPTunnelSetHelper.cpp b/dbms/src/Flash/Mpp/MPPTunnelSetHelper.cpp index b5f47b7bc78..5499a9cad68 100644 --- a/dbms/src/Flash/Mpp/MPPTunnelSetHelper.cpp +++ b/dbms/src/Flash/Mpp/MPPTunnelSetHelper.cpp @@ -175,7 +175,7 @@ TrackedMppDataPacketPtr ToCompressedPacket( assert(uncompressed_source); for ([[maybe_unused]] const auto & chunk : uncompressed_source->getPacket().chunks()) { - assert(chunk.empty()); + assert(!chunk.empty()); assert(static_cast(chunk[0]) == CompressionMethodByte::NONE); } From 1cc7500393aee566447ac9503be38196ab7e5972 Mon Sep 17 00:00:00 2001 From: JaySon-Huang Date: Tue, 21 Mar 2023 22:57:11 +0800 Subject: [PATCH 8/8] Revert "Temporary disable async-grpc test" This reverts commit 81a677541a8ffb6f5387fc54deb00ce9105439f2. --- tests/tidb-ci/run.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/tidb-ci/run.sh b/tests/tidb-ci/run.sh index 60062c92236..bb7a5f5283d 100755 --- a/tests/tidb-ci/run.sh +++ b/tests/tidb-ci/run.sh @@ -33,10 +33,9 @@ docker-compose -f cluster.yaml -f tiflash-dt.yaml exec -T tiflash0 bash -c 'cd / docker-compose -f cluster.yaml -f tiflash-dt.yaml down clean_data_log -#TODO: Fix it https://github.com/pingcap/tiflash/issues/7120 -#docker-compose -f cluster.yaml -f tiflash-dt-async-grpc.yaml up -d -#wait_env -#docker-compose -f cluster.yaml -f tiflash-dt-async-grpc.yaml exec -T tiflash0 bash -c 'cd /tests ; ./run-test.sh tidb-ci/async_grpc' +docker-compose -f cluster.yaml -f tiflash-dt-async-grpc.yaml up -d +wait_env +docker-compose -f cluster.yaml -f tiflash-dt-async-grpc.yaml exec -T tiflash0 bash -c 'cd /tests ; ./run-test.sh tidb-ci/async_grpc' docker-compose -f cluster.yaml -f tiflash-dt-async-grpc.yaml down clean_data_log