-
Notifications
You must be signed in to change notification settings - Fork 1.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
[BUG] Evaulate and update all generation fields in SegmentCommitInfo during primary promotion #5701
Comments
Looking into it |
Hey, im not sure if its related but i have been running an experiment using segment replication using an opensearch 2.4.1 cluster with 9 nodes:
I started facing it after adding 6 nodes to the cluster ( to have 15 in total ) and restarting the opensearch processes on all nodes to add some static configuration. Since then the cluster has been performing relocations and failing due to this error i suppose. All of this was performed under production load. |
Thank you @mhoffm-aiven for sharing this issue. This is really important to make the feature more robust when tested under production workload. So, thank you again! In order to repro this issue, can you please share the cluster configuration, index settings and type of operations (index/update/delete), workload size. |
Hey @dreamer-89, sorry i already deleted the cluster, from memory though, cluster configuration that was different from our default was
the indexes were created using this template
using these settings
I noticed that the service was relocating shards constantly after adding 6 nodes and restarting the cluster by accident ( i mistakenly configured Workload was |
@mhoffm-aiven, were _bulk index and "occasional index deletes" happening concurrently? Curious, what was the total number of documents?
Old segrep indexes? Or just old random indexes? Also, I noticed these are time based indexes using index sorting. @dreamer-89, do we have a test for this configuration? There is also a |
Thank you @nknize for the comment. No, there is no test for this configuration. We will add one, thanks for bringing this up. Regarding issue, I suspect it happens because of shard re-balancing after addition of new nodes. The addition of new nodes results in shard relocation where segment file conflicts after primary promotion and is a known issue. The fix for the issue recently merged into 2.x but did not make into |
Hey @nknize, There were _bulk index operations happening concurrently but not for indexes that were to be deleted ( those have been 2 days with no new documents ); deleted indexes were old segrep indexes yes. |
@mhoffm-aiven this is helpful. Do you have any data characteristics we could use to repro a scenario w/ a similar synthetic test data set? Number of docs, number of fields? Did you change any of the default _bulk parameters?
Did you perform a full cluster or rolling restart? |
Hey @nknize, sorry for the late response, i was a bit swarmed. I checked, no _bulk parameters were changed, _bulk payloads are one megabyte in size, i dont know how many documents, it might change since it are log lines; i collected them into one megabyte payloads and then flushed by issuing the accumulated _bulk request. The mapping is basically a I did restart all opensearch processes (by accident) while in the process of draining and adding nodes iirc. Do you need any more detail? |
We've since added better logging to print the segments in conflict when this is caught again. In the meantime have done some digging on these gen fields.
Will take a look at #6369 in an effort to better select a new primary. The original counter increase was an extra guardrail to prevent against behind replicas getting select as primary & re-writing segments under the same name. We could easily identify this case on syncing replicas by considering primary term, but would clobber the file and break ongoing queries. |
The .liv files are named using the delGen values. However, in our current implementation, internalEngine is only using softDeletes so we would not be creating any .liv files that would have to be copied over to the replica. Since there are no .liv files, this scenario will not present a problem in the current implementation, so closing it. We could revisit it if any change in implementation of deletes occur. |
Coming from #4365 (comment), we need to relook into different SegmentCommitInfo generations and update if needed. As part of this bug, identify use of different generation fields in SegmentCommitInfo and possibly bump them as well.
The text was updated successfully, but these errors were encountered: