Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue 43666: Add skip_unavailable_shards as a setting for Distributed…
… table. This setting, when enabled (disabled by default), allows ClickHouse to silently skip unavailable shards of a Distributed table during a query execution, instead of throwing an exception to the client.
- Loading branch information
Showing
7 changed files
with
51 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
tests/queries/0_stateless/02916_distributed_skip_unavailable_shards.reference
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
1234 abcd 1 | ||
1234 abcd 1 |
28 changes: 28 additions & 0 deletions
28
tests/queries/0_stateless/02916_distributed_skip_unavailable_shards.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
-- Tags: shard, long | ||
|
||
DROP TABLE IF EXISTS table_02916; | ||
DROP TABLE IF EXISTS table_02916_distributed; | ||
|
||
CREATE TABLE table_02916 | ||
( | ||
`ID` UInt32, | ||
`Name` String | ||
) | ||
ENGINE = MergeTree | ||
ORDER BY ID; | ||
|
||
INSERT INTO table_02916 VALUES (1234, 'abcd'); | ||
|
||
CREATE TABLE table_02916_distributed | ||
( | ||
`ID` UInt32, | ||
`Name` String | ||
) | ||
ENGINE = Distributed(test_unavailable_shard, currentDatabase(), table_02916, rand()) | ||
SETTINGS skip_unavailable_shards = 1; | ||
|
||
SELECT *, _shard_num FROM table_02916_distributed; | ||
SELECT *, _shard_num FROM table_02916_distributed SETTINGS skip_unavailable_shards=0; -- { serverError ALL_CONNECTION_TRIES_FAILED } | ||
|
||
DROP TABLE table_02916_distributed; | ||
DROP TABLE table_02916; |