glusterd2 icon indicating copy to clipboard operation
glusterd2 copied to clipboard

failed to enable brick mux options

Open Madhu-1 opened this issue 6 years ago • 6 comments

Observed behavior

failed to enable brick mux options

Expected/desired behavior

brick mux value must be set to true

Details on how to reproduce (minimal and precise)

  • send HTTP request to enable brick mux
#curl http://gluster-kube1-0.glusterd2.gcs:24007/v1/cluster/options -d '{"cluster.brick-multiplex": "on"}' -X POST  
{}
  • Not that body should not be empty, need to fix this problem also
  • if I sent multiple requests with same request body, the request should fail saying, something like cluster option already set to the same value
  • checking the response using GET request
#curl http://gluster-kube1-0.glusterd2.gcs:24007/v1/cluster/options  |python -m json.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   494  100   494    0     0  48440      0 --:--:-- --:--:-- --:--:-- 54888
[
    {
        "default": "off",
        "key": "cluster.shared-storage",
        "modified": false,
        "value": "off"
    },
    {
        "default": "50000",
        "key": "cluster.op-version",
        "modified": false,
        "value": "50000"
    },
    {
        "default": "50000",
        "key": "cluster.max-op-version",
        "modified": false,
        "value": "50000"
    },
    {
        "default": "off",
        "key": "cluster.brick-multiplex",
        "modified": false,
        "value": "off"
    },
    {
        "default": "0",
        "key": "cluster.max-bricks-per-process",
        "modified": false,
        "value": "0"
    },
    {
        "default": "off",
        "key": "cluster.localtime-logging",
        "modified": false,
        "value": "off"
    }
]

Madhu-1 avatar Dec 06 '18 05:12 Madhu-1

the nightly container is 3 days old in the docker hub, means brickmux code is not present. how glusterd2 is understanding cluster.brick-multiplex option

@atinmu @vpandey-RH

Madhu-1 avatar Dec 06 '18 05:12 Madhu-1

same continues for setting cluster.max-bricks-per-process

  • POST
curl http://gluster-kube1-0.glusterd2.gcs:24007/v1/cluster/options -d '{"cluster.max-bricks-per-process": "osafdasdfasdf"}' -X POST -v
* About to connect() to gluster-kube1-0.glusterd2.gcs port 24007 (#0)
*   Trying 10.233.64.6...
* Connected to gluster-kube1-0.glusterd2.gcs (10.233.64.6) port 24007 (#0)
> POST /v1/cluster/options HTTP/1.1
> User-Agent: curl/7.29.0
> Host: gluster-kube1-0.glusterd2.gcs:24007
> Accept: */*
> Content-Length: 51
> Content-Type: application/x-www-form-urlencoded
> 
* upload completely sent off: 51 out of 51 bytes
< HTTP/1.1 200 OK
< Content-Type: application/json; charset=UTF-8
< X-Gluster-Cluster-Id: e85a2410-1462-4711-bba5-f7457345e672
< X-Gluster-Peer-Id: 8c3e5603-0c10-49cd-a1f9-067f8f057daa
< X-Request-Id: 16b52f1a-cb99-4a1e-815d-30e4a2c8c3c3
< Date: Thu, 06 Dec 2018 05:25:49 GMT
< Content-Length: 3
< 
{}
  • GET request
curl http://gluster-kube1-0.glusterd2.gcs:24007/v1/cluster/options  |python -m json.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   494  100   494    0     0  50331      0 --:--:-- --:--:-- --:--:-- 54888
[
    {
        "default": "off",
        "key": "cluster.localtime-logging",
        "modified": false,
        "value": "off"
    },
    {
        "default": "off",
        "key": "cluster.shared-storage",
        "modified": false,
        "value": "off"
    },
    {
        "default": "50000",
        "key": "cluster.op-version",
        "modified": false,
        "value": "50000"
    },
    {
        "default": "50000",
        "key": "cluster.max-op-version",
        "modified": false,
        "value": "50000"
    },
    {
        "default": "off",
        "key": "cluster.brick-multiplex",
        "modified": false,
        "value": "off"
    },
    {
        "default": "0",
        "key": "cluster.max-bricks-per-process",
        "modified": false,
        "value": "0"
    }
]

cluster.max-bricks-per-process values are in integers, how this is accepting some junk string values and returning success response?

Madhu-1 avatar Dec 06 '18 05:12 Madhu-1

@aravindavk PTAL

Madhu-1 avatar Dec 06 '18 05:12 Madhu-1

All the global options were already introduced by commit 3296ec8 way earlier. the brick multiplexing changes which went in recently just allowed to actually enable that option. We need to test this with latest master (once the nightly container issue is resolved).

atinmu avatar Dec 06 '18 05:12 atinmu

@Madhu-1 The above call for setting the brick-multiplex on, doesn't exist.

The call should be -

curl -XPOST http://localhost:24007/v1/cluster/options -d '{"options":{"cluster.brick-multiplex": "on"}}'

I will also add the validation for setting the brick-multiplex option.

vpandey-RH avatar Dec 06 '18 18:12 vpandey-RH

if the call doesn't exist we should fail the request.

as you see in the above request, even the request body is not proper. validation is missing

Madhu-1 avatar Dec 07 '18 04:12 Madhu-1