Druid return empty response as 200OK?

Hi,
I was testing my druid cluster with a single historical node.

I realized that when the historical was a brand new ec2 instance without any downloaded data, druid would return an empty response as 200OK to my query.

After about an hour when the historical have enough data, it returns a valid response.

Is this the expected behavior? How can I know my historical nodes have enough data to query or not?

Tried to read docs about this but didn’t find, any help is appreciated.

Thanks.

Gulin

Hi Gulin,

Historical GET APIs /druid/historical/v1/loadstatus, /druid/historical/v1/readiness tell the readiness of the Historicals for querying.
Look at https://druid.apache.org/docs/latest/operations/api-reference.html#historical

Thanks,

Sashi

Hi Sashidhar,
Thanks for your reply! That is very helpful.

But why does the broker still return a 200OK with an empty response when the only historical node is not ready at all? Isn’t some error code make more sense? Do we have documentation to explain that?

Thanks.

Gulin

Hi Gulin,

IMO 200 OK is a reasonably right response (debatable) , it’s just that no datasources are available and/or available for querying and may not be an error scenario as such. I don’t know of any documentation which explains this. The Druid API designers might answer this better.

Thanks,

Sashi

IMO, getting 200 is a perfectly valid response. Take this as an analogy - if a table in a relational database (Oracle for example) is empty, “select *” on that table will not throw an error.

If you wish to know why the response is empty, there are already a bunch of APIs to discern that.

That makes sense! Thanks a lot!