Skip to content

Commit

Permalink
MB-52735 Configurable max buckets supported
Browse files Browse the repository at this point in the history
The maximum buckets supported on a cluster can be set via the config
profile. This is done for serverless to change the maximum to 100
buckets.

Change-Id: Ice836b4f79be5b39704788c9a4200fc12355d427
Reviewed-on: https://review.couchbase.org/c/ns_server/+/177440
Well-Formed: Build Bot <build@couchbase.com>
Tested-by: Steve Watanabe <steve.watanabe@couchbase.com>
Reviewed-by: Hareen Kancharla <hareen.kancharla@couchbase.com>
  • Loading branch information
stevewatanabe committed Jul 13, 2022
1 parent 75146d6 commit a483829
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions etc/serverless_profile
@@ -1,6 +1,7 @@
{name, "serverless"}.
{enable_system_scope, true}.
{enable_bucket_placer, true}.
{max_buckets_supported, 100}.
{allow_variable_num_vbuckets, true}.
{default_num_vbuckets, 64}.
{max_scopes_per_bucket, 100}.
Expand Down
2 changes: 1 addition & 1 deletion src/menelaus_web_settings.erl
Expand Up @@ -540,7 +540,7 @@ conf(internal) ->
get_number(1, 1024)},
{{couchdb, max_parallel_replica_indexers}, maxParallelReplicaIndexers,
<<>>, get_number(1, 1024)},
{max_bucket_count, maxBucketCount, ?MAX_BUCKETS_SUPPORTED,
{max_bucket_count, maxBucketCount, ns_bucket:get_max_buckets(),
get_number(1, 8192)},
{magma_min_memory_quota, magmaMinMemoryQuota, 1024,
get_number(100, 1024, 1024)},
Expand Down
4 changes: 3 additions & 1 deletion src/ns_bucket.erl
Expand Up @@ -811,7 +811,9 @@ is_valid_bucket_name_inner([Char | Rest]) ->
end.

get_max_buckets() ->
ns_config:read_key_fast(max_bucket_count, ?MAX_BUCKETS_SUPPORTED).
Default = config_profile:get_value(max_buckets_supported,
?MAX_BUCKETS_SUPPORTED),
ns_config:read_key_fast(max_bucket_count, Default).

get_default_num_vbuckets() ->
case ns_config:search(couchbase_num_vbuckets_default) of
Expand Down
3 changes: 2 additions & 1 deletion src/ns_config_default.erl
Expand Up @@ -113,7 +113,8 @@ default() ->
{{node, node(), is_enterprise}, IsEnterprise},
{{node, node(), saslauthd_enabled}, SASLAuthdEnabled},
{index_aware_rebalance_disabled, false},
{max_bucket_count, ?MAX_BUCKETS_SUPPORTED},
{max_bucket_count, config_profile:get_value(max_buckets_supported,
?MAX_BUCKETS_SUPPORTED)},
{autocompaction, [{database_fragmentation_threshold, {30, undefined}},
{view_fragmentation_threshold, {30, undefined}}]},
{set_view_update_daemon,
Expand Down

0 comments on commit a483829

Please sign in to comment.