Description
Auto-Compaction database/view fragmentation percentage fields cannot be unchecked: if the user unchecks those fields, the next refresh will show the previously saved value.
We need the same behaviour as database/view size fields which was implemented in these changes:
https://review.couchbase.org/c/ns_server/+/169527
https://review.couchbase.org/c/ns_server/+/169688
- 0 should not be an invalid value anymore so the UI can send it as a reset value
- UI should receive "undefined" for a percentage that was reset
The current behaviour is like this:
When the user unchecks database fragmentation percentage and clicks Save, UI sends this payload to controller/setAutoCompaction
databaseFragmentationThreshold[size]: 12582912
|
viewFragmentationThreshold[percentage]: 30
|
magmaFragmentationPercentage: 50
|
indexCompactionMode: circular
|
indexCircularCompaction[daysOfWeek][Monday]: true
|
indexCircularCompaction[daysOfWeek][Tuesday]: true
|
indexCircularCompaction[daysOfWeek][Wednesday]: true
|
indexCircularCompaction[daysOfWeek][Thursday]: true
|
indexCircularCompaction[daysOfWeek][Friday]: true
|
indexCircularCompaction[daysOfWeek][Saturday]: true
|
indexCircularCompaction[daysOfWeek][Sunday]: true
|
indexCircularCompaction[interval][fromHour]: 0
|
indexCircularCompaction[interval][toHour]: 0
|
indexCircularCompaction[interval][fromMinute]: 0
|
indexCircularCompaction[interval][toMinute]: 0
|
indexCircularCompaction[interval][abortOutside]: false
|
parallelDBAndViewCompaction: false
|
purgeInterval: 3
|
So databaseFragmentationThreshold[percentage] property is not sent (currently 0 can't be sent because it's an invalid value);
UI gets back these properties from settings/autoCompaction:
{"autoCompactionSettings":{"databaseFragmentationThreshold":{"percentage":30,"size":12582912},
|
"viewFragmentationThreshold":{"percentage":30,"size":"undefined"},
|
"parallelDBAndViewCompaction":false,
|
"magmaFragmentationPercentage":50,
|
"indexCompactionMode":"circular","indexCircularCompaction":{"daysOfWeek":"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday","interval":{"fromHour":0,"toHour":0,"fromMinute":0,"toMinute":0,"abortOutside":false}},"indexFragmentationThreshold":{"percentage":30}},"purgeInterval":3}
|
databaseFragmentationThreshold.percentage being 30 instead of "undefined" will show this value to the user:
What UI needs to fix this issue:
- UI should be able to send databaseFragmentationThreshold[percentage]: 0 and viewFragmentationThreshold[percentage]: 0 when posting to controller/setAutoCompaction
- GET settings/autoCompaction should return "undefined" for databaseFragmentationThreshold.percentage and databaseFragmentationThreshold.percentage if they were previously set with 0
Attachments
Issue Links
- relates to
-
MB-50509 [UI] Settings not saved in auto compaction page
- Closed