API to disable segments for interval not working

From docs found here: https://druid.apache.org/docs/latest/tutorials/tutorial-delete-data.html

[karthik@localhost ~]$ curl -v -X ‘POST’ -H ‘Content-Type:application/json’ -d ‘{ “interval” : “2002-01-01T00:00:00.000Z/2004-12-31T00:00:00.000Z” }’ http://localhost:8081/druid/coordinator/v1/datasources/test/markUnused

  • About to connect() to localhost port 8081 (#0)

  • Trying ::1…

  • Connected to localhost (::1) port 8081 (#0)

POST /druid/coordinator/v1/datasources/ffs/markUnused HTTP/1.1

User-Agent: curl/7.29.0

Host: localhost:8081

Accept: /

Content-Type:application/json

Content-Length: 40

  • upload completely sent off: 40 out of 40 bytes

< HTTP/1.1 404 Not Found

< Date: Tue, 23 Jul 2019 05:24:16 GMT

< Content-Length: 0

< Server: Jetty(9.4.10.v20180503)

<

  • Connection #0 to host localhost left intact

``

I get a 404. Please help, this is kinda urgent. (have a workaround but we have a large dataset and cost is taking a hit)

Thats a new API thats added recently. See the below github issue

https://github.com/apache/incubator-druid/issues/7439

Please see the tutorial relevant to your version of druid. For e.g. for 0.14.0 please check the below link

https://druid.apache.org/docs/0.14.0-incubating/tutorials/tutorial-delete-data.html

https://druid.apache.org/docs/0.14.0-incubating/operations/api-reference.html

As you could see above there is no markUnused API.

Hi Muthu,

Thanks… I was indeed should have been looking at 0.14.2. Apologies… However when I try delete on the below endpoint, I get a 200 response… But the segment is not disabled.

http://router-url/druid/coordinator/v1/datasources/kar/intervals/2016-08-01_2016-08-30

``

I verified the interval by specifying the below payload to “/druid/coordinator/v1/metadata/datasources/kar/segments” endpoint

[“2016-08-01/2016-08-30”]

``

However, if I hit the below API by specifying the segment id (I have only one segment in the above interval), it works like a charm.

http://router-url/druid/coordinator/v1/datasources/kar/segments/kar_2016-08-29T00:00:00.000Z_2016-09-05T00:00:00.000Z_2019-07-24T03:49:53.897Z

``

Any idea what I am missing here?

Any help?

So just so that I understand. You are able to disable the segment using the coordinator delete API. However the question is why the below API is not working

  • /druid/coordinator/v1/datasources/{dataSourceName}/intervals/{interval}

Yes.

Can you check your overlord logs to see if there are any errors / exception ?

I get a 200 response but I will still check.vi didn’t see any errors with info log level. I will change log level to debug and see if I see anything.

Btw, coordinator logs or overlord?

overlord logs. You should see that the task is looking for segment to disable.

Checked internally and it seems that API should mark segment as unsed but its trying to kill and since its used it fails. Seems to be an issue. Can you create a github issue for the same in the below link?

https://github.com/apache/incubator-druid