What is the issue?
Currently, when using the
couchbase-cli setting-autofailover
|
command, setting the --enable-failover-on-data-disk-issues flag to 0 requires --failover-data-disk-period to be set as well. If --failover-data-disk-period is not set, the following error is returned:
ERROR: --failover-data-disk-period must be set when auto-failover on Data Service disk is enabled
|
This is not the expected behaviour as disabling data disk failover should not require data disk period to be set as well.
Steps to reproduce
janu@janu-lenovo:~$ couchbase-cli setting-autofailover -c localhost:9000 -u Administrator -p asdasd --enable-auto-failover 1 --enable-failover-on-data-disk-issues 0 --auto-failover-timeout 110
|
ERROR: --failover-data-disk-period must be set when auto-failover on Data Service disk is enabled
|
Results with the fix
janu@janu-lenovo:~$ couchbase-cli setting-autofailover -c localhost:9000 -u Administrator -p asdasd --enable-auto-failover 1 --enable-failover-on-data-disk-issues 0 --auto-failover-timeout 110
|
SUCCESS: Auto-failover settings modified
|
janu@janu-lenovo:~$ http GET localhost:9000/settings/autoFailover -a Administrator:asdasd
|
HTTP/1.1 200 OK
|
|
{
|
"count": 0,
|
"disableMaxCount": false,
|
"enabled": true,
|
"failoverOnDataDiskIssues": {
|
"enabled": false,
|
"timePeriod": 120
|
},
|
"failoverPreserveDurabilityMajority": false,
|
"maxCount": 1,
|
"timeout": 110
|
}
|
And if we try to set --enable-failover-on-data-disk-issues to 1 without supplying --failover-data-disk-period:
janu@janu-lenovo:~$ couchbase-cli setting-autofailover -c localhost:9000 -u Administrator -p asdasd --enable-auto-failover 1 --enable-failover-on-data-disk-issues 1 --auto-failover-timeout 110
|
ERROR: --failover-data-disk-period must be set when auto-failover on Data Service disk is enabled
|
And with supplying --failover-data-disk-period:
janu@janu-lenovo:~$ couchbase-cli setting-autofailover -c localhost:9000 -u Administrator -p asdasd --enable-auto-failover 1 --enable-failover-on-data-disk-issues 1 --failover-data-disk-period 100 --auto-failover-timeout 110
|
SUCCESS: Auto-failover settings modified
|
janu@janu-lenovo:~$ http GET localhost:9000/settings/autoFailover -a Administrator:asdasd
|
HTTP/1.1 200 OK
|
|
{
|
"count": 0,
|
"disableMaxCount": false,
|
"enabled": true,
|
"failoverOnDataDiskIssues": {
|
"enabled": true,
|
"timePeriod": 100
|
},
|
"failoverPreserveDurabilityMajority": false,
|
"maxCount": 1,
|
"timeout": 140
|
}
|