Description
Issue
It seems that mcctl can't parse valid JSON when using set sla. The error may be linked to the number of args as reducing the total args down to <= 4 gives the expected behaviour.
Reproduction steps
Spin up a 7.0.3 cluster. Then
# Get sla
|
$ /opt/couchbase/bin/mcctl -h localhost:11210 -u Administrator -P asdasd get sla
|
{"COMPACT_DB":{"slow":"1800 s"},"CREATE_BUCKET":{"slow":"5 s"},"DELETE_BUCKET":{"slow":"10 s"},"SELECT_BUCKET":{"slow":"10 ms"},"SEQNO_PERSISTENCE":{"slow":"30 s"},"comment":"Current MCBP SLA configuration","default":{"slow":"500 ms"},"version":1}
|
|
# Change sla
|
$ /opt/couchbase/bin/mcctl -h localhost:11210 -u Administrator -P asdasd set sla '{"default":{"slow":"100 ms"},"version":1}'
|
|
# Verify
|
$ /opt/couchbase/bin/mcctl -h localhost:11210 -u Administrator -P asdasd get sla
|
{"comment":"Current MCBP SLA configuration","default":{"slow":"100 ms"},"version":1}
|
|
# Revert back to default gives error
|
$ /opt/couchbase/bin/mcctl -h localhost:11210 -u Administrator -P asdasd set sla '{"COMPACT_DB":{"slow":"1800 s"},"CREATE_BUCKET":{"slow":"5 s"},"DELETE_BUCKET":{"slow":"10 s"},"SELECT_BUCKET":{"slow":"10 ms"},"SEQNO_PERSISTENCE":{"slow":"30 s"},"default":{"slow":"500 ms"},"version":1}'
|
ioctl_set 'sla' failed: Invalid arguments (4)
|
|
$ /opt/couchbase/bin/mcctl -h localhost:11210 -u Administrator -P asdasd get sla
|
{"comment":"Current MCBP SLA configuration","default":{"slow":"100 ms"},"version":1}
|
|
# >4 args
|
$ /opt/couchbase/bin/mcctl -h localhost:11210 -u Administrator -P asdasd set sla '{"COMPACT_DB":{"slow":"1800 s"},"CREATE_BUCKET":{"slow":"5 s"},"DELETE_BUCKET":{"slow":"10 s"},"SELECT_BUCKET":{"slow":"10 ms"},"SEQNO_PERSISTENCE":{"slow":"30 s"},"version":1}'
|
ioctl_set 'sla' failed: Invalid arguments (4)
|
|
# >4 args
|
$ /opt/couchbase/bin/mcctl -h localhost:11210 -u Administrator -P asdasd set sla '{"COMPACT_DB":{"slow":"1800 s"},"CREATE_BUCKET":{"slow":"5 s"},"DELETE_BUCKET":{"slow":"10 s"},"SELECT_BUCKET":{"slow":"10 ms"},"version":1}'
|
ioctl_set 'sla' failed: Invalid arguments (4)
|
|
# <= 4 args
|
$ /opt/couchbase/bin/mcctl -h localhost:11210 -u Administrator -P asdasd set sla '{"COMPACT_DB":{"slow":"1800 s"},"CREATE_BUCKET":{"slow":"5 s"},"DELETE_BUCKET":{"slow":"10 s"},"version":1}'
|
|
$ /opt/couchbase/bin/mcctl -h localhost:11210 -u Administrator -P asdasd get sla
|
{"COMPACT_DB":{"slow":"1800 s"},"CREATE_BUCKET":{"slow":"5 s"},"DELETE_BUCKET":{"slow":"10 s"},"comment":"Current MCBP SLA configuration","default":{"slow":"100 ms"},"version":1}
|