Skip to content

Commit b9ccefe

Browse files
committed
Reverse forcemerge and refresh order
Otherwise, opensearch does not clear old segment files Signed-off-by: Heemin Kim <heemin@amazon.com>
1 parent d8cad3a commit b9ccefe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/org/opensearch/geospatial/ip2geo/common/GeoIpDataFacade.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ public void createIndexIfNotExists(final String indexName) {
121121
private void freezeIndex(final String indexName) {
122122
TimeValue timeout = clusterSettings.get(Ip2GeoSettings.TIMEOUT);
123123
StashedThreadContext.run(client, () -> {
124-
client.admin().indices().prepareRefresh(indexName).execute().actionGet(timeout);
125124
client.admin().indices().prepareForceMerge(indexName).setMaxNumSegments(1).execute().actionGet(timeout);
125+
client.admin().indices().prepareRefresh(indexName).execute().actionGet(timeout);
126126
client.admin()
127127
.indices()
128128
.prepareUpdateSettings(indexName)

0 commit comments

Comments
 (0)