Skip to content

Commit

Permalink
MB-48248 Don't return magma-specific props for non-magma buckets
Browse files Browse the repository at this point in the history
We'll no longer return magma-specific properties, e.g.
fragmentationPercentage or memQuotaRatio) for non-magma buckets.

Change-Id: Ifdff43dab49e5192770b8b5ca719fbd0fa6df1e6
Reviewed-on: http://review.couchbase.org/c/ns_server/+/162120
Tested-by: Steve Watanabe <steve.watanabe@couchbase.com>
Well-Formed: Build Bot <build@couchbase.com>
Reviewed-by: Abhijeeth Nuthan <abhijeeth.nuthan@couchbase.com>
  • Loading branch information
stevewatanabe committed Sep 22, 2021
1 parent 8800909 commit 371eca8
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/menelaus_web_buckets.erl
Expand Up @@ -298,9 +298,7 @@ build_dynamic_bucket_info(InfoLevel, Id, BucketConfig, Ctx) ->
{storageBackend, ns_bucket:storage_backend(BucketConfig)},
{durabilityMinLevel, build_durability_min_level(BucketConfig)},
build_pitr_dynamic_bucket_info(BucketConfig),
{fragmentationPercentage,
proplists:get_value(frag_percent, BucketConfig, 50)},
{memQuotaRatio, proplists:get_value(mem_quota_ratio, BucketConfig, 10)},
build_magma_bucket_info(BucketConfig),
{conflictResolutionType,
ns_bucket:conflict_resolution_type(BucketConfig)}],
case cluster_compat_mode:is_enterprise() of
Expand Down Expand Up @@ -330,6 +328,17 @@ build_pitr_dynamic_bucket_info(BucketConfig) ->
{pitrMaxHistoryAge, ns_bucket:pitr_max_history_age(BucketConfig)}]
end.

build_magma_bucket_info(BucketConfig) ->
case ns_bucket:storage_mode(BucketConfig) of
magma ->
[{fragmentationPercentage, proplists:get_value(frag_percent,
BucketConfig, 50)},
{memQuotaRatio, proplists:get_value(mem_quota_ratio,
BucketConfig, 10)}];
_ ->
[]
end.

handle_sasl_buckets_streaming(_PoolId, Req) ->
LocalAddr = menelaus_util:local_addr(Req),

Expand Down

0 comments on commit 371eca8

Please sign in to comment.