-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Reindex can ignore op_type create when using external version #37855
Comments
Pinging @elastic/es-core-features |
Pinging @elastic/es-distributed |
Hey @ismael-hasan what would be a good starting point to start fixing this issue 😄 |
Hi @kwojcicki , I was the one who encountered this. @ismael-hasan opened this issue after he helped me diagnose it in a support call. For me, it was confusing that the The way I see it, the Perhaps an easy "fix" would be to return an error if |
@ismael-hasan you are right about that Working on the issue. |
@stjasink I'm still tracking down the issue but it sees from this code op_type create should not be used with version_type external? PS: But that's not where the error comes from though. I'm just trying to understand the expected behavior |
@ivange94 That check sounds sensible. Would it make sense to do the same check in https://github.com/elastic/elasticsearch/blob/master/server/src/main/java/org/elasticsearch/index/reindex/ReindexRequest.java to avoid the situation I encountered? |
op_type create should only be used with version_type external Closes elastic#37855
Is issue is still open? If so, what requirements are there, if any, for a PR? |
Elasticsearch version (
bin/elasticsearch --version
): 6.5.2Plugins installed: []
JVM version (
java -version
): Java 10.0.2OS version (
uname -a
if on a Unix-like system): Windows 10Description of the problem including expected versus actual behavior:
In a reindex, when
op_type
is set ascreate
and we use external versioning we can update documents already existing in the destination index. Ifop_type
is set ascreate
, it is not expected that we can update existing documents; quoting the reindex documentation:Steps to reproduce:
Create a test index with 1 document:
Reindex to another
test2
index withop_type
create
(it will work):Reindex again to the same index; in this case it will fail due to versioning (it is expected that it fails for
op_type
create
, but not sure if it fails incidentally due to versioning and it is already ignoring the op_type). The request is the same as in the previous step, the response is:Reindex again to the same index, but overwriting the version with scripting. In this case, regardless of the document already existing in the destination and
op_type
beingcreate
, it will update that document:The text was updated successfully, but these errors were encountered: