Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update system indices with fixed no. of primary shards & auto expand replicas #1426

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,14 @@ class AlertIndices(
logger.debug("index: [$index] schema mappings: [$schemaMapping]")
val request = CreateIndexRequest(index)
.mapping(schemaMapping)
.settings(Settings.builder().put("index.hidden", true).build())
.settings(
Settings
.builder()
.put("index.hidden", true)
.put("number_of_shards", "1")
.put("index.auto_expand_replicas", "0-all")
.build()
)

if (alias != null) request.alias(Alias(alias))
return try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@ class DocLevelMonitorQueries(private val client: Client, private val clusterServ
.mapping(docLevelQueriesMappings())
.alias(Alias(alias))
.settings(
Settings.builder().put("index.hidden", true)
Settings
.builder()
.put("index.hidden", true)
.put("number_of_shards", "1")
.put("index.auto_expand_replicas", "0-all")
.build()
)
return try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,7 @@ class MonitorRestApiIT : AlertingRestTestCase() {
if (isMultiNode) {
assertEquals("Scheduled job index is not green", "green", alertingStats["scheduled_job_index_status"])
} else {
assertEquals("Scheduled job index is not yellow", "yellow", alertingStats["scheduled_job_index_status"])
assertEquals("Scheduled job index is not green", "green", alertingStats["scheduled_job_index_status"])
}
assertEquals("Nodes are not on schedule", numberOfNodes, alertingStats["nodes_on_schedule"])

Expand Down Expand Up @@ -1043,7 +1043,7 @@ class MonitorRestApiIT : AlertingRestTestCase() {
if (isMultiNode) {
assertEquals("Scheduled job index is not green", "green", responseMap["scheduled_job_index_status"])
} else {
assertEquals("Scheduled job index is not yellow", "yellow", responseMap["scheduled_job_index_status"])
assertEquals("Scheduled job index is not green", "green", responseMap["scheduled_job_index_status"])
}
assertEquals("Nodes are not on schedule", numberOfNodes, responseMap["nodes_on_schedule"])

Expand Down Expand Up @@ -1078,7 +1078,7 @@ class MonitorRestApiIT : AlertingRestTestCase() {
if (isMultiNode) {
assertEquals("Scheduled job index is not green", "green", responseMap["scheduled_job_index_status"])
} else {
assertEquals("Scheduled job index is not yellow", "yellow", responseMap["scheduled_job_index_status"])
assertEquals("Scheduled job index is not green", "green", responseMap["scheduled_job_index_status"])
}
assertEquals("Nodes not on schedule", numberOfNodes, responseMap["nodes_on_schedule"])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,14 @@ class ScheduledJobIndices(private val client: AdminClient, private val clusterSe
if (!scheduledJobIndexExists()) {
var indexRequest = CreateIndexRequest(ScheduledJob.SCHEDULED_JOBS_INDEX)
.mapping(scheduledJobMappings())
.settings(Settings.builder().put("index.hidden", true).build())
.settings(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to add some comments (documentation) for rationale behind the primary and replica count?

Settings
.builder()
.put("index.hidden", true)
.put("number_of_shards", "1")
.put("index.auto_expand_replicas", "0-all")
.build()
)
client.indices().create(indexRequest, actionListener)
}
}
Expand Down
6 changes: 4 additions & 2 deletions core/src/main/resources/settings/doc-level-queries.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"limit": 10000
}
},
"hidden": true
}
"hidden": true,
"auto_expand_replicas": "0-all"
},
"number_of_shards": 1
}
Loading