Skip to content

Commit 579e18e

Browse files
authored
Only attempt to rollover signals index if version < builtin version (#84982) (#84996)
1 parent 6059568 commit 579e18e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/create_index_route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export const createDetectionIndex = async (
7878
const indexExists = await getIndexExists(callCluster, index);
7979
if (indexExists) {
8080
const indexVersion = await getIndexVersion(callCluster, index);
81-
if (indexVersion !== SIGNALS_TEMPLATE_VERSION) {
81+
if ((indexVersion ?? 0) < SIGNALS_TEMPLATE_VERSION) {
8282
await callCluster('indices.rollover', { alias: index });
8383
}
8484
} else {

x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/read_index_route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export const readIndexRoute = (router: IRouter) => {
3838
let mappingOutdated: boolean | null = null;
3939
try {
4040
const indexVersion = await getIndexVersion(clusterClient.callAsCurrentUser, index);
41-
mappingOutdated = indexVersion !== SIGNALS_TEMPLATE_VERSION;
41+
mappingOutdated = (indexVersion ?? 0) < SIGNALS_TEMPLATE_VERSION;
4242
} catch (err) {
4343
const error = transformError(err);
4444
// Some users may not have the view_index_metadata permission necessary to check the index mapping version

0 commit comments

Comments
 (0)