Skip to content

Commit 138bd8e

Browse files
MB-49624 Add all bucket config keys modifiable via UI in ...
... bucket_cfg_changed event log It seems like the UI now sends only keys that are changed in the bucket edit section. Retrieve all the relevant keys that can be changed via the UI and add their "new value" in the new_settings section. Also fixed a case where I added an event_log at the end of case expression which could have masked any errors generated by ns_bucket:update_props/2. Sad story. Change-Id: I6b2ce4008ebaff743754365969972034da6baf5b Reviewed-on: https://review.couchbase.org/c/ns_server/+/166019 Well-Formed: Build Bot <[email protected]> Tested-by: Build Bot <[email protected]> Tested-by: Hareen Kancharla <[email protected]> Reviewed-by: Steve Watanabe <[email protected]>
1 parent 11d463c commit 138bd8e

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

src/ns_bucket.erl

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -995,16 +995,26 @@ update_bucket_props(Type, StorageMode, BucketName, Props) ->
995995
DisplayBucketType = ns_bucket:display_type(Type, StorageMode),
996996

997997
%% Update the bucket properties.
998-
update_bucket_props(BucketName, Props),
999-
1000-
event_log:add_log(bucket_cfg_changed,
1001-
[{bucket, list_to_binary(BucketName)},
1002-
{bucket_uuid, uuid(BucketName, direct)},
1003-
{type, DisplayBucketType},
1004-
{old_settings,
1005-
{struct, build_bucket_props_json(PrevProps)}},
1006-
{new_settings,
1007-
{struct, build_bucket_props_json(Props)}}]);
998+
RV = update_bucket_props(BucketName, Props),
999+
1000+
case RV of
1001+
ok ->
1002+
{ok, NewBucketConfig} = ns_bucket:get_bucket(BucketName),
1003+
NewProps = extract_bucket_props(NewBucketConfig),
1004+
event_log:add_log(bucket_cfg_changed,
1005+
[{bucket, list_to_binary(BucketName)},
1006+
{bucket_uuid, uuid(BucketName, direct)},
1007+
{type, DisplayBucketType},
1008+
{old_settings,
1009+
{struct, build_bucket_props_json(
1010+
PrevProps)}},
1011+
{new_settings,
1012+
{struct, build_bucket_props_json(
1013+
NewProps)}}]),
1014+
ok;
1015+
_ ->
1016+
RV
1017+
end;
10081018
false ->
10091019
{exit, {not_found, BucketName}, []}
10101020
end.

0 commit comments

Comments
 (0)