Skip to content
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

[BUG] Version conflict during document recreation #12384

Open
singh-abhishek opened this issue Feb 20, 2024 · 2 comments
Open

[BUG] Version conflict during document recreation #12384

singh-abhishek opened this issue Feb 20, 2024 · 2 comments
Assignees
Labels
bug Something isn't working Indexing Indexing, Bulk Indexing and anything related to indexing

Comments

@singh-abhishek
Copy link

singh-abhishek commented Feb 20, 2024

Describe the bug

If I create a document with version=1 and version_type=external_gte and then delete the document, the subsequent document creation with version=1 and version_type=external_gte fails with version conflict.

Related component

Indexing

To Reproduce

#create index
curl -XPUT "http://opensearch.opensearch:9200/identifier" -H 'Content-Type: application/json' -d'{ "settings": { "index": { "number_of_shards": 1, "number_of_replicas": 1 } }, "mappings": { "properties": { "id": { "type": "integer" } } }}'

#insert document
curl -XPUT "http://opensearch.opensearch:9200/identifier/_doc/1?version=1&version_type=external_gte" -H 'Content-Type: application/json' -d'{ "id": 1}'

#delete document
curl -XDELETE "http://opensearch.opensearch:9200/identifier/_doc/1"

#insert same document again
curl -XPUT "http://opensearch.opensearch:9200/identifier/_doc/1?version=1&version_type=external_gte" -H 'Content-Type: application/json' -d'{ "id": 1}'

#get this error
{
"error" : {
"root_cause" : [
{
"type" : "version_conflict_engine_exception",
"reason" : "[1]: version conflict, current version [2] is higher than the one provided [1]",
"index" : "identifier",
"shard" : "0",
"index_uuid" : "45deXZY1RqWBO5cj8v0c7A"
}
],
"type" : "version_conflict_engine_exception",
"reason" : "[1]: version conflict, current version [2] is higher than the one provided [1]",
"index" : "identifier",
"shard" : "0",
"index_uuid" : "45deXZY1RqWBO5cj8v0c7A"
},
"status" : 409
}

Expected behavior

A document with the same version and content should be recreated after it has been already deleted.

Additional Details

Plugins
Please list all plugins currently enabled.

Screenshots
If applicable, add screenshots to help explain your problem.

Host/Environment (please complete the following information):

  • OS: [e.g. iOS]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@singh-abhishek singh-abhishek added bug Something isn't working untriaged labels Feb 20, 2024
@github-actions github-actions bot added the Indexing Indexing, Bulk Indexing and anything related to indexing label Feb 20, 2024
@mgodwan
Copy link
Member

mgodwan commented Feb 21, 2024

@dhwanilpatel Can you check this?

@pajamaw
Copy link

pajamaw commented Dec 17, 2024

Was there any update on this? Finding myself with the same issue

@singh-abhishek

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Indexing Indexing, Bulk Indexing and anything related to indexing
Projects
None yet
Development

No branches or pull requests

4 participants