Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Make `indices.memory.index_buffer_size` dynamically updatable #7550
This is PR for #7045
It also makes related settings (min/max_index_buffer_size and min/max_shard_index_buffer_size dynamically updatable.
But I have some concerns I wasn't sure about. First, whether the ShardsIndicesStatusChecker.run (the methods that "bubbles down" the allowed RAM to all active shards) is thread-safe or not since it can now be called from two threads at once. Probably I will just put a lock around it to be safe ...
Second, I just added these to ClusterDynamicSettingsModule, yet I use NodeSettingsService.addListener to subscribe to changes; is this right? Also, in the test, I'm using "persistent" cluster settings, but I'm not familiar with this (where do these changes persist?) and I couldn't figure out how to do a full restart and confirm the dynamic changes did in fact persist somewhere ... so I could use some pointers here :)
OK I simplified the test, added docs, added test cases to catch a bug in my last iteration that would lose previous settings (revert them to defaults) if you changed only one setting.
But the tests faile during cleanup because ElasticsearchSingleNodeTest is upset that I left persistent cluster settings behind ... how can I fix that? (Is it bad to use persistent settings?) I noticed ElasticsearchIntegrationTest has a ClusterScope annotation that lets you turn off this checking, but ESSingleNodeTest doesn't...
referenced this pull request
Sep 5, 2014
OK I folded in all feedback, but... the new test cases intermittently fail, because the settings have not actually changed after the request returns.
I suspect the change is actually asynchronous? Like I must somehow wait for the cluster state to be updated / onRefreshSettings invoked, not just for the request to return (.get())? Maybe this is what @kimchy was getting at with assertBusy... but then I tried using assertBusy as well, which tries for up to 10 seconds to get assertions passing, but it also fails ... now I'm confused :) I'll keep digging...