Skip to content

Commit

Permalink
MB-49314 Prevent GET /diag/masterEvents?o=1 failure post bucket creation
Browse files Browse the repository at this point in the history
On adding a bucket with magma store with non-default database fragamentation
settings, /diag/masterEvents fails. Massage the JSON term to prevent it.

Change-Id: I6ad75c110eb87add910d82c39771a7eddc3a4a83
Reviewed-on: https://review.couchbase.org/c/ns_server/+/166955
Tested-by: Hareen Kancharla <hareen.kancharla@couchbase.com>
Well-Formed: Build Bot <build@couchbase.com>
Reviewed-by: Meni Hillel <meni.hillel@couchbase.com>
  • Loading branch information
hareen-kancharla committed Dec 6, 2021
1 parent 6f96ff4 commit bd3e8d2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ns_orchestrator.erl
Expand Up @@ -610,8 +610,9 @@ idle({create_bucket, BucketType, BucketName, NewConfig}, From, _State) ->
end,
case Reply of
ok ->
NewConfigJSON = ns_bucket:build_bucket_props_json(NewConfig),
master_activity_events:note_bucket_creation(BucketName, BucketType,
NewConfig),
NewConfigJSON),
StorageMode = proplists:get_value(storage_mode, NewConfig,
undefined),
event_log:add_log(
Expand All @@ -620,7 +621,7 @@ idle({create_bucket, BucketType, BucketName, NewConfig}, From, _State) ->
{bucket_uuid, ns_bucket:uuid(BucketName, direct)},
{bucket_type, ns_bucket:display_type(BucketType, StorageMode)},
{bucket_props,
{struct, ns_bucket:build_bucket_props_json(NewConfig)}}]),
{struct, NewConfigJSON}}]),
request_janitor_run({bucket, BucketName});
_ -> ok
end,
Expand Down

0 comments on commit bd3e8d2

Please sign in to comment.