Skip to content

Commit e4499cd

Browse files
committed
continue fix database errors related to database with engine=Replicated, fix #1127
Signed-off-by: Slach <[email protected]>
1 parent 9dcdeaf commit e4499cd

File tree

2 files changed

+31
-6
lines changed

2 files changed

+31
-6
lines changed

test/integration/dynamic_settings.sh

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ EOT
488488
fi
489489

490490
# WINDOW VIEW available 21.12+
491-
if [[ "${CLICKHOUSE_VERSION}" == "head" || "${CLICKHOUSE_VERSION}" =~ ^2[2-9]\.[1-9] || "${CLICKHOUSE_VERSION}" =~ ^21\.1[1-2] ]]; then
491+
if [[ "${CLICKHOUSE_VERSION}" == "head" || "${CLICKHOUSE_VERSION}" =~ ^2[2-9]\.[1-9] || "${CLICKHOUSE_VERSION}" =~ ^21\.12 ]]; then
492492

493493
cat <<EOT > /etc/clickhouse-server/users.d/allow_experimental_window_view.xml
494494
<yandex>
@@ -548,7 +548,7 @@ EOT
548548
fi
549549

550550

551-
if [[ "${CLICKHOUSE_VERSION}" =~ ^2[0]\.[1-3] ]]; then
551+
if [[ "${CLICKHOUSE_VERSION}" =~ ^20\.[1-3] ]]; then
552552

553553
cat <<EOT > /etc/clickhouse-server/users.d/low_memory_in_usersd.xml
554554
<yandex>
@@ -572,7 +572,7 @@ cat <<EOT > /etc/clickhouse-server/config.d/low_memory_in_configd.xml
572572
</yandex>
573573
EOT
574574

575-
elif [[ "${CLICKHOUSE_VERSION}" =~ ^2[0]\.[4-9] ]]; then
575+
elif [[ "${CLICKHOUSE_VERSION}" =~ ^20\.[4-9] ]]; then
576576

577577
cat <<EOT > /etc/clickhouse-server/users.d/low_memory_in_usersd.xml
578578
<yandex>
@@ -597,7 +597,7 @@ cat <<EOT > /etc/clickhouse-server/config.d/low_memory_in_configd.xml
597597
</yandex>
598598
EOT
599599

600-
elif [[ "${CLICKHOUSE_VERSION}" =~ ^21\. ]]; then
600+
elif [[ "${CLICKHOUSE_VERSION}" =~ ^21\.[1-9]$ || "${CLICKHOUSE_VERSION}" =~ ^21\.10 ]]; then
601601

602602
cat <<EOT > /etc/clickhouse-server/users.d/low_memory_in_usersd.xml
603603
<yandex>
@@ -621,6 +621,30 @@ cat <<EOT > /etc/clickhouse-server/config.d/low_memory_in_configd.xml
621621
</yandex>
622622
EOT
623623

624+
elif [[ "${CLICKHOUSE_VERSION}" =~ ^21\.1[1-9] ]]; then
625+
626+
cat <<EOT > /etc/clickhouse-server/users.d/low_memory_in_usersd.xml
627+
<yandex>
628+
<profiles>
629+
<default>
630+
<background_pool_size>2</background_pool_size>
631+
<background_buffer_flush_schedule_pool_size>1</background_buffer_flush_schedule_pool_size>
632+
<background_message_broker_schedule_pool_size>1</background_message_broker_schedule_pool_size>
633+
<background_fetches_pool_size>1</background_fetches_pool_size>
634+
<background_merges_mutations_concurrency_ratio>2</background_merges_mutations_concurrency_ratio>
635+
</default>
636+
</profiles>
637+
</yandex>
638+
EOT
639+
640+
cat <<EOT > /etc/clickhouse-server/config.d/low_memory_in_configd.xml
641+
<yandex>
642+
<tables_loader_foreground_pool_size>0</tables_loader_foreground_pool_size>
643+
<tables_loader_background_pool_size>0</tables_loader_background_pool_size>
644+
<background_merges_mutations_scheduling_policy>round_robin</background_merges_mutations_scheduling_policy>
645+
</yandex>
646+
EOT
647+
624648
elif [[ "${CLICKHOUSE_VERSION}" =~ ^22\. ]]; then
625649

626650
cat <<EOT > /etc/clickhouse-server/users.d/low_memory_in_usersd.xml
@@ -676,7 +700,7 @@ EOT
676700
fi
677701

678702

679-
if [[ "${CLICKHOUSE_VERSION}" == "head" || "${CLICKHOUSE_VERSION}" =~ ^21\.[3-9]+ || "${CLICKHOUSE_VERSION}" =~ ^2[2-9]\.[1-9]+ ]]; then
703+
if [[ "${CLICKHOUSE_VERSION}" == "head" || "${CLICKHOUSE_VERSION}" =~ ^21\.[3-9]+ || "${CLICKHOUSE_VERSION}" =~ ^21\.1[0-9]+ || "${CLICKHOUSE_VERSION}" =~ ^2[2-9]\.[1-9]+ ]]; then
680704
cat <<EOT > /etc/clickhouse-server/users.d/allow_experimental_database_replicated.xml
681705
<yandex>
682706
<profiles><default><allow_experimental_database_replicated>1</allow_experimental_database_replicated></default></profiles>

test/integration/integration_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3548,7 +3548,8 @@ func addTestDataIfNotExistsAndReplaceRowsIfExists(testData []TestDataStruct, new
35483548
func generateTestDataForDifferentServerVersion(remoteStorageType string, offset, rowsCount int, testData []TestDataStruct) []TestDataStruct {
35493549
log.Debug().Msgf("generateTestDataForDifferentServerVersion remoteStorageType=%s", remoteStorageType)
35503550
// https://github.com/Altinity/clickhouse-backup/issues/1127
3551-
if compareVersion(os.Getenv("CLICKHOUSE_VERSION"), "21.3") >= 0 {
3551+
// CREATE TABLE engine=Replicated available from 21.3, but ATTACH PART, available only from 21.11
3552+
if compareVersion(os.Getenv("CLICKHOUSE_VERSION"), "21.11") >= 0 {
35523553
databaseEngine := "Replicated('/clickhouse/{cluster}/{database}','{shard}','{replica}')"
35533554
testData = addTestDataIfNotExistsAndReplaceRowsIfExists(testData, TestDataStruct{
35543555
Name: "table_in_replicated_db",

0 commit comments

Comments
 (0)