-
Notifications
You must be signed in to change notification settings - Fork 24.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TSDB: Test create_doc
permission
#86638
Conversation
Pinging @elastic/es-analytics-geo (Team:Analytics) |
This adds a test for the `create_doc` and `index` permissions into tsdb indices.
Pinging @elastic/clients-team (Team:Clients) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for adding a test!
@elasticmachine update branch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test LGTM, but I have a question.
index: | ||
refresh: true | ||
index: test | ||
op_type: index |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious what happens without this?
I assume that AutoIdHandler
will set the op_type to create
and then TSDB will reject the request because a document with the (auto generated) id already exists.
Is that the intended semantics of the {ts-index}/_doc
endpoint - if there's a possibility that there might be an existing doc for the same tsid, then you need to set the op_type or be prepared to handle a failure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the AutoIdHandler
will only set the op_type to create if no op_type has been specified. So it will overwrite a document?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. It's a bit weird to me, but that's what happens. Without this you get create and overwrites stop in their tracks. I think it's a good thing that this isn't index dependent, but it is weird. And for _bulk we don't see it because folks say create
or index
. It's a quirk that'll have to be documented for tsdb.
This adds a test for the
create_doc
andindex
permissions into tsdbindices.