I've tried running POST /_forcemerge?only_expunge_deletes=true multiple times, but it doesn't seem to do anything. The command returns Gateway Timeout Expired.
Is there a known issue with POST /_forcemerge?only_expunge_deletes=true on v6.6?
The upgrade isn't happening anytime soon, since it's out of my control. It's running on prem. Besides, I would imagine, it isn't easy to upgrade a multi-terabyte instance that is backing up a 24/7 operation.
Hi @rgelb I am pretty sure we have work together before as I was at CoreLogic...
So besides making sure that you have a direct connection to Elasticsearch, there's a couple things with force merge that are not obvious sometimes.
force merge happens on the node of the primary shard is and in essence there needs to be enough disk space to do it. If There's not enough disk space and I would say think about Let's just say anywhere from additional 50 to 90% of the primary shard size will need to be available on that node... Otherwise it will not be able to complete... I.e It needs room to build the new segments before I can get rid of the old segments.
Second is with that many segments and depending on what the underlying hardware is, it could take quite some time.... Quite some time.
With the cat segments, you'll be able to see if the new segments are being created... Or not.
GET /_cat/segments?v
You should also be able to use the task API believe to see what is running...or not.
And yes, it'll be a significant task to upgrade but it can be done... at Some point assuming this is a business critical app.. We have experts that can help with that.
@stephenb I never worked at CoreLogic, but I've worked with the company a number of times on various real estate projects. Your name does sound familiar.
The issue with space... There is about 40% of space remaining.
And for each node (last one being the master):
Assuming that is the case, I should still be able to clean up deleted records from an index that only has a few. For example, index newsarticles_web01_dev_637044237457830355 has 7833 indexed documents and 3 deleted ones.
Surely, I should be able to issue a forcemerge command on this index: POST newsarticles_web01_dev_637044237457830355/_forcemerge?only_expunge_deletes=true
But it results in a timeout as well and nothing happens.
Run these what are the results ... new segments are not available until after _refresh
POST newsarticles_web01_dev_637044237457830355/_refresh
GET _cat/segments/newsarticles_web01_dev_637044237457830355/?v
GET _cat/indices/newsarticles_web01_dev_637044237457830355/?v
Please don't post images. Please paste in the text. Many people cannot even read the images, especially on mobile devices and I can't be searched or debugged.
max_num_segments The number of segments to merge to. To fully merge the index, set it to 1 . Defaults to simply checking if a merge needs to execute, and if so, executes it.
So Basically elasticsearch does not think it needs to merge so it does not!!! so nothing is happening!
POST /newsarticles_web01_dev_637044237457830355/_forcemerge?max_num_segments=1
POST /newsarticles_web01_dev_637044237457830355/_refresh
GET _cat/segments/newsarticles_web01_dev_637044237457830355/?v
That will collapse down to a single segment per shard and get rid of the deleted docs
BTW Force Merging Indices to a single segment that are read only can (not always) save space and make searching more efficient...
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.