diff --git a/src/backend/distributed/master/master_node_protocol.c b/src/backend/distributed/master/master_node_protocol.c index 625f9202a..bdb55e20c 100644 --- a/src/backend/distributed/master/master_node_protocol.c +++ b/src/backend/distributed/master/master_node_protocol.c @@ -55,6 +55,7 @@ /* Shard related configuration */ +int ShardCount = 32; int ShardReplicationFactor = 2; /* desired replication factor for shards */ int ShardMaxSize = 1048576; /* maximum size in KB one shard can grow to */ int ShardPlacementPolicy = SHARD_PLACEMENT_ROUND_ROBIN; diff --git a/src/backend/distributed/shared_library_init.c b/src/backend/distributed/shared_library_init.c index 149cd3d13..8d8a9b125 100644 --- a/src/backend/distributed/shared_library_init.c +++ b/src/backend/distributed/shared_library_init.c @@ -332,6 +332,17 @@ RegisterCitusConfigVariables(void) 0, NULL, NULL, NULL); + DefineCustomIntVariable( + "citus.shard_count", + gettext_noop("Sets the number of shards for a new hash-partitioned table" + "created with create_distributed_table()."), + NULL, + &ShardCount, + 32, 1, 64000, + PGC_USERSET, + 0, + NULL, NULL, NULL); + DefineCustomIntVariable( "citus.shard_replication_factor", gettext_noop("Sets the replication factor for shards."), diff --git a/src/include/distributed/master_protocol.h b/src/include/distributed/master_protocol.h index 18c5451a4..9a08ebbb5 100644 --- a/src/include/distributed/master_protocol.h +++ b/src/include/distributed/master_protocol.h @@ -82,6 +82,7 @@ typedef enum /* Config variables managed via guc.c */ +extern int ShardCount; extern int ShardReplicationFactor; extern int ShardMaxSize; extern int ShardPlacementPolicy;