Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-51883

mcctl can't parse valid JSON

    XMLWordPrintable

Details

    • Task
    • Resolution: Fixed
    • Major
    • 7.1.0
    • 7.0.3
    • memcached
    • None
    • 1

    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}

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            trond Trond Norbye
            Elliot.goodwin Elliot Goodwin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty