File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
server/src/main/java/org/elasticsearch/cluster/metadata Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change 1414import org .elasticsearch .common .regex .Regex ;
1515import org .elasticsearch .core .Nullable ;
1616import org .elasticsearch .core .Tuple ;
17+ import org .elasticsearch .index .Index ;
1718import org .elasticsearch .index .IndexNotFoundException ;
1819import org .elasticsearch .indices .SystemIndices .SystemIndexAccessLevel ;
1920
@@ -158,7 +159,26 @@ public static boolean isIndexVisible(
158159 if (indexAbstraction .isSystem ()) {
159160 // check if it is net new
160161 if (resolver .getNetNewSystemIndexPredicate ().test (indexAbstraction .getName ())) {
161- return isSystemIndexVisible (resolver , indexAbstraction );
162+ // don't give this code any particular credit for being *correct*. it's just trying to resolve a combination of
163+ // issues in a way that happens to *work*. there's probably a better way of writing things such that this won't
164+ // be necessary, but for the moment, it happens to be expedient to write things this way.
165+
166+ // unwrap the alias and re-run the function on the write index of the alias -- that is, the alias is visible if
167+ // the concrete index that it refers to is visible
168+ Index writeIndex = indexAbstraction .getWriteIndex ();
169+ if (writeIndex == null ) {
170+ return false ;
171+ } else {
172+ return isIndexVisible (
173+ expression ,
174+ selectorString ,
175+ writeIndex .getName (),
176+ indicesOptions ,
177+ metadata ,
178+ resolver ,
179+ includeDataStreams
180+ );
181+ }
162182 }
163183 }
164184
You can’t perform that action at this time.
0 commit comments