The POST /_reshard/jobs endpoint is not working with any existing db name while I was using the main branch.
curl --location --request POST 'http://127.0.0.1:15984/_reshard/jobs' \
--header 'Content-Type: application/json' \
--data-raw '{
"db": "_users",
"type": "split"
}'
Results with a 400 error however the _users db is existing:
{
"error": "bad_request",
"reason": "Invalid `db`"
}
I tried this out with other existing db names as well, but those are not working as well.
An odd thing is when I try out the endpoint with the _dbs value:
curl --location --request POST 'http://127.0.0.1:15984/_reshard/jobs' \
--header 'Content-Type: application/json' \
--data-raw '{
"db": "_dbs",
"type": "split"
}'
It results an 500 error:
[
{
"error": "{'EXIT',\n {function_clause,\n [{mem3_reshard,shard_from_name,\n [<<\"_dbs\">>],\n [{file,\"src/mem3_reshard.erl\"},{line,199}]},\n {mem3_reshard,start_split_job,1,\n [{file,\"src/mem3_reshard.erl\"},{line,93}]},\n {rpc,local_call,3,[{file,\"rpc.erl\"},{line,321}]},\n {mem3_reshard_api,'-create_jobs/5-fun-0-',1,\n [{file,\"src/mem3_reshard_api.erl\"},{line,32}]},\n {lists,map,2,[{file,\"lists.erl\"},{line,1239}]},\n {mem3_reshard_httpd,handle_reshard_req,1,\n [{file,\"src/mem3_reshard_httpd.erl\"},{line,108}]},\n {chttpd,handle_req_after_auth,2,[{file,\"src/chttpd.erl\"},{line,330}]},\n {chttpd,process_request,1,[{file,\"src/chttpd.erl\"},{line,311}]}]}}",
"node": "[email protected]",
"shard": "_dbs"
}
]
[
{
"ok": true,
"id": "001-46df42bb53df24c7d32212982479c85e7f4b5bdfe04526b47a0e3000899af438",
"node": "nonode@nohost",
"shard": "shards/00000000-7fffffff/_global_changes.1614539418"
},
{
"ok": true,
"id": "001-8964009e85822a354ac67412d003f5aa05d5c5adf9f37b70f5453e859250b6fa",
"node": "nonode@nohost",
"shard": "shards/80000000-ffffffff/_global_changes.1614539418"
}
]
You probably want the 3.x branch, not main, which doesn't have the 2.x/3.x concept of shards anymore.
Thanks for the information, @wohali!
If main does not have the concept of shards anymore, could the response code be a 403 or a 410 then? I think the 400 error message (Invalid `db`) is misleading here.
It also came to my notice that some of the GET reshard endpoints are working while I was running the main branch, so I would like to ask for similar response codes there if you reach the point where you turn off the reshard endpoints properly. Thanks in front!
main is under heavy development towards 4.0 and is not feature complete, as far as I understand.
I would not be using it at the moment and would stick with 3.x for any production use.
I'm sure a pass will be done to clean up the removed endpoints for 4.0.