Skip to content

Commit 9fe7b3b

Browse files
authored
Ensure no_src benchmarks run with soft_deletes disabed
[1] makes `index.soft_deletes.enabled: True` the index default. soft_deletes require the doc source stored and if source gets explicitly disabled during index creation, Elasticsearch will use a `_recovery_source` [2] instead to store the source. To allow the execution of no_src benchmarks, explicitly disable soft_deletes for the specific combinations. [1] elastic@51800de [2] elastic#31106 Relates elastic#90
1 parent 062e0cf commit 9fe7b3b

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed

night_rally/resources/tracks.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,11 @@
310310
"charts": ["indexing"],
311311
"challenge": "append-no-conflicts-index-only",
312312
"track-params": {
313+
"index_settings": {
314+
"index.number_of_shards": 5,
315+
"index.number_of_replicas": 0,
316+
"index.soft_deletes.enabled": false
317+
},
313318
"source_enabled": false
314319
},
315320
"car": "4gheap"
@@ -346,6 +351,11 @@
346351
"charts": ["indexing"],
347352
"challenge": "append-index-only-with-ingest-pipeline",
348353
"track-params": {
354+
"index_settings": {
355+
"index.number_of_shards": 5,
356+
"index.number_of_replicas": 0,
357+
"index.soft_deletes.enabled": false
358+
},
349359
"source_enabled": false,
350360
"ingest_pipeline": "grok"
351361
},

tests/night_rally_test.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,51 @@ def test_run_adhoc_benchmark(self, mocked_wait_until_port_is_free):
242242
system_call.calls
243243
)
244244

245+
@mock.patch('night_rally.night_rally.wait_until_port_is_free', return_value=True)
246+
def test_run_track_with_soft_deletes_and_src_disabled(self, mocked_wait_until_port_is_free):
247+
system_call = RecordingSystemCall(return_value=False)
248+
self.maxDiff=None
249+
tracks = [
250+
{
251+
"track": "http_logs",
252+
"configurations": [
253+
{
254+
"name": "http_logs-no-src-1node",
255+
"challenge": "append-no-conflicts-index-only",
256+
"car": "4gheap",
257+
"track-params": {
258+
"index_settings": {
259+
"index.number_of_shards": 5,
260+
"index.number_of_replicas": 0,
261+
"index.soft_deletes.enabled": False
262+
},
263+
"source_enabled": False
264+
}
265+
}
266+
]
267+
}
268+
]
269+
270+
start_date = datetime.datetime(2016, 1, 1)
271+
params = [night_rally.StandardParams("nightly", start_date, 8, {"env": "bare"})]
272+
cmd = night_rally.NightlyCommand(params, start_date)
273+
night_rally.run_rally(tracks, ["localhost"], cmd, skip_ansible=True, system=system_call)
274+
self.assertEqual(1, len(system_call.calls))
275+
self.assertEqual(
276+
[
277+
"rally --skip-update --configuration-name=\"nightly\" --quiet --target-host=\"localhost:39200\" "
278+
"--effective-start-date=\"2016-01-01 00:00:00\" --track=\"http_logs\" "
279+
"--challenge=\"append-no-conflicts-index-only\" --car=\"4gheap\" --client-options=\"timeout:240\" "
280+
"--user-tag=\"env:bare,name:http_logs-no-src-1node\" --runtime-jdk=\"8\" "
281+
"--track-params=\"{\\\"index_settings\\\": {\\\"index.number_of_shards\\\": 5, "
282+
"\\\"index.number_of_replicas\\\": 0, \\\"index.soft_deletes.enabled\\\": false}, "
283+
"\\\"source_enabled\\\": false}\" "
284+
"--pipeline=\"from-sources-complete\" "
285+
"--revision=\"@2016-01-01T00:00:00Z\"" ]
286+
,
287+
system_call.calls
288+
)
289+
245290
@mock.patch('night_rally.night_rally.wait_until_port_is_free', return_value=True)
246291
def test_run_release_benchmark_without_plugins(self, mocked_wait_until_port_is_free):
247292
system_call = RecordingSystemCall(return_value=False)

0 commit comments

Comments
 (0)