-
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
Change put mapping priority to URGENT #42105
Comments
Pinging @elastic/es-distributed |
Fluctuating nodes sounds like the more fundamental problem here. Why is this happening? If your cluster is unstable then I would expect performance issues such as the one you describe, and although the performance characteristics would be different with the change you propose I don't think they would necessarily be better. Starting shards in a timely fashion is quite important. The consequence of delaying a mapping update should be a bounded amount of buffering on the coordinator; if this bound is exceeded then the coordinator should start to reject requests. Is this what you're seeing? |
By fluctuating nodes it could be a cluster scale up/down/zone changes that could also cause this essentially slowing down throughput. As far as the memory on the coordinator node is concerned here is another problem #35564. Changing the priority helps both the cases although they both would need their own specialized solution . Do you think there are major gains in keeping the priority |
I would not expect scaling the cluster up or down to swamp the master with
I think that issue is now mis-titled, because I expect the coordinating node not to run out of memory in such a situation in recent versions. That issue is making failed put-mapping calls fail faster, which would cause bulk rejections sooner. That doesn't sound like what you want. I've adjusted the title of the linked issue. |
There is no notion of
|
I don't understand why |
Typically not all the 200 shards start at the same time(due to varying sizes) and once one shard does start, master queues up a |
Ok I think I see. You seem to be saying that the master is receiving a stream of relatively few If so, I don't think adjusting the priority of mapping updates will solve this problem. Even if mapping update tasks were top priority they'd still have to occasionally wait for a lower-priority task time since there is no pre-emption mechanism. If they have equal priority then you would still see starvation occurring because the tasks aren't executed fairly. I also think that increasing the priority of things is the wrong way to address this kind of performance issue. The logical conclusion of that line of thinking is that everything becomes top priority, but then nothing works. Instead, I think you should look at the following areas:
|
Yes that seems correct
I understand there is no pre-emption, but the mapping update in the midst of streams of
IMHO shard relocation should have relatively low priority as compared to mapping updates espl given that these mapping updates are directly impacting client traffic and that these updates are relatively faster and cheaper than Having said that fluctuating node was just one scenario, AZ/hardware changes are the most common scenarios. Working on the remaining part of the optimization is on my radar will get back on that. The optimization wouldn't cover all cases and worst case would still be few seconds per iteration |
This is not true, because (as I said) the enqueued tasks aren't executed fairly.
I do not share this opinion. Starting shards promptly is vital for resilience, and I think it is correct to prioritise resilience over indexing performance as we do today. I will re-iterate that the thing that's slowing your indexing down is your use of dynamic mapping updates, which means that your indexing process needs the master's involvement. Solve that, and the problem you describe here will go away. We've discussed this internally and concluded that adjusting the priorities as suggested here is not the right thing to do, so I'm closing this. |
I think it's of importance for unassigned shards but does this hold good for shards already assigned. The point here is why should indexing performance suffer if say a |
Today we reroute the cluster as part of the process of starting a shard, which runs at `URGENT` priority. In large clusters, rerouting may take some time to complete, and this means that a mere trickle of shard-started events can cause starvation for other, lower-priority, tasks that are pending on the master. However, it isn't really necessary to perform a reroute when starting a shard, as long as one occurs eventually. This commit removes the inline reroute from the process of starting a shard and replaces it with a deferred one that runs at `NORMAL` priority, avoiding starvation of higher-priority tasks. This may improve some of the situations related to elastic#42738 and elastic#42105.
* Defer reroute when starting shards Today we reroute the cluster as part of the process of starting a shard, which runs at `URGENT` priority. In large clusters, rerouting may take some time to complete, and this means that a mere trickle of shard-started events can cause starvation for other, lower-priority, tasks that are pending on the master. However, it isn't really necessary to perform a reroute when starting a shard, as long as one occurs eventually. This commit removes the inline reroute from the process of starting a shard and replaces it with a deferred one that runs at `NORMAL` priority, avoiding starvation of higher-priority tasks. This may improve some of the situations related to #42738 and #42105. * Specific test case for followup priority setting We cannot set the priority in all InternalTestClusters because the deprecation warning makes some tests unhappy. This commit adds a specific test instead. * Checkstyle * Cluster state always changed here * Assert consistency of routing nodes * Restrict setting only to reasonable priorities
* Defer reroute when starting shards Today we reroute the cluster as part of the process of starting a shard, which runs at `URGENT` priority. In large clusters, rerouting may take some time to complete, and this means that a mere trickle of shard-started events can cause starvation for other, lower-priority, tasks that are pending on the master. However, it isn't really necessary to perform a reroute when starting a shard, as long as one occurs eventually. This commit removes the inline reroute from the process of starting a shard and replaces it with a deferred one that runs at `NORMAL` priority, avoiding starvation of higher-priority tasks. This may improve some of the situations related to elastic#42738 and elastic#42105. * Specific test case for followup priority setting We cannot set the priority in all InternalTestClusters because the deprecation warning makes some tests unhappy. This commit adds a specific test instead. * Checkstyle * Cluster state always changed here * Assert consistency of routing nodes * Restrict setting only to reasonable priorities
Problem Description
Bulk Index request which change the mapping of the index can cause put mapping requests. These requests need to be send across to the master for processing and all this while other bulk requests are held up on the co-ordinator node for processing. This is a problem if there are high priority items with priority
URGENT
already queued up on master(too many shard-started events due to fluctuating nodes)as this would cause a surge in memory pressure for the coordinating nodes and bulk indexing to get slowed downThe text was updated successfully, but these errors were encountered: