Skip to content

Commit adeb000

Browse files
committed
Don’t close the ES index before updating settings (#4858)
The only settings we auto-fix are dynamic settings, and we don’t need to close the index first before changing those. Closing/opening an index appears to cause quite a bit of stress on the clusters.
1 parent c28633a commit adeb000

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

search/includes/classes/class-health.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1128,7 +1128,7 @@ public function heal_index_settings_for_indexable( \ElasticPress\Indexable $inde
11281128
$desired_settings_to_heal = self::limit_index_settings_to_keys( $desired_settings, self::INDEX_SETTINGS_HEALTH_AUTO_HEAL_KEYS );
11291129
$index_name = $indexable->get_index_name();
11301130
if ( method_exists( '\Automattic\VIP\Search\Search', 'should_load_new_ep' ) && \Automattic\VIP\Search\Search::should_load_new_ep() ) {
1131-
$result = $this->elasticsearch->update_index_settings( $index_name, $desired_settings_to_heal, true );
1131+
$result = $this->elasticsearch->update_index_settings( $index_name, $desired_settings_to_heal, false );
11321132
} else {
11331133
$result = $indexable->update_index_settings( $desired_settings_to_heal );
11341134
}

tests/search/includes/classes/test-class-health.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1182,7 +1182,7 @@ public function test_heal_index_settings_for_indexable( $desired_settings, $opti
11821182

11831183
$health->elasticsearch->expects( $this->once() )
11841184
->method( 'update_index_settings' )
1185-
->with( $index_name, $expected_updated_settings, true );
1185+
->with( $index_name, $expected_updated_settings, false );
11861186

11871187
$result = $health->heal_index_settings_for_indexable( $mocked_indexable, $options );
11881188

0 commit comments

Comments
 (0)