-
Notifications
You must be signed in to change notification settings - Fork 246
Expand file tree
/
Copy pathbackpressure-retry-loop.yml.template
More file actions
220 lines (193 loc) · 7.16 KB
/
backpressure-retry-loop.yml.template
File metadata and controls
220 lines (193 loc) · 7.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
# Tests in this file are generated from backpressure-retry-loop.yml.template.
description: tests that operations respect overload backoff retry loop
schemaVersion: '1.3'
runOnRequirements:
- minServerVersion: '4.4' # failCommand
topologies: [replicaset, sharded, load-balanced]
createEntities:
- client:
id: &client client
useMultipleMongoses: false
observeEvents: [commandStartedEvent, commandSucceededEvent, commandFailedEvent]
ignoreCommandMonitoringEvents: [killCursors]
- client:
id: &internal_client internal_client
useMultipleMongoses: false
- database:
id: &internal_db internal_db
client: *internal_client
databaseName: &database_name retryable-writes-tests
- collection:
id: &internal_collection retryable-writes-tests
database: *internal_db
collectionName: &collection_name coll
- database:
id: &database database
client: *client
databaseName: *database_name
- collection:
id: &collection collection
database: *database
collectionName: *collection_name
- client:
id: &client_retryReads_false client_retryReads_false
useMultipleMongoses: false
observeEvents: [commandStartedEvent, commandSucceededEvent, commandFailedEvent]
ignoreCommandMonitoringEvents: [killCursors]
uriOptions:
retryReads: false
- database:
id: &database_retryReads_false database_retryReads_false
client: *client_retryReads_false
databaseName: *database_name
- collection:
id: &collection_retryReads_false collection_retryReads_false
database: *database_retryReads_false
collectionName: *collection_name
- client:
id: &client_retryWrites_false client_retryWrites_false
useMultipleMongoses: false
observeEvents: [commandStartedEvent, commandSucceededEvent, commandFailedEvent]
ignoreCommandMonitoringEvents: [killCursors]
uriOptions:
retryWrites: false
- database:
id: &database_retryWrites_false database_retryWrites_false
client: *client_retryWrites_false
databaseName: *database_name
- collection:
id: &collection_retryWrites_false collection_retryWrites_false
database: *database_retryWrites_false
collectionName: *collection_name
initialData:
- collectionName: *collection_name
databaseName: *database_name
documents: []
_yamlAnchors:
bulWriteInsertNamespace: &client_bulk_write_ns retryable-writes-tests.coll
tests: {% for operation in operations %}
- description: '{{operation.object}}.{{operation.operation_name}}{{ " " + operation.operation_type + "" if operation.operation_name == "aggregate" else "" }} retries using operation loop' {%- if ((operation.operation_name == 'clientBulkWrite')) %}
runOnRequirements:
- minServerVersion: '8.0' # client bulk write added to server in 8.0
{%- endif %}
operations: {%- if operation.operation_name == "dropIndex" %}
- name: createIndex
object: *internal_collection
arguments:
keys: { x: 11 }
name: "x_11"
{%- endif %}
- name: failPoint
object: testRunner
arguments:
client: *internal_client
failPoint:
configureFailPoint: failCommand
mode: { times: 3 }
data:
failCommands: [{{operation.command_name}}]
errorLabels: [RetryableError, SystemOverloadedError]
errorCode: 2
- name: {{operation.operation_name}}
object: *{{operation.object}}
{%- if operation.arguments|length > 0 %}
arguments:
{%- for arg in operation.arguments %}
{{arg}}
{%- endfor -%}
{%- endif %}
expectEvents:
- client: *client
events:
- commandStartedEvent:
commandName: {{operation.command_name}}
- commandFailedEvent:
commandName: {{operation.command_name}}
- commandStartedEvent:
commandName: {{operation.command_name}}
- commandFailedEvent:
commandName: {{operation.command_name}}
- commandStartedEvent:
commandName: {{operation.command_name}}
- commandFailedEvent:
commandName: {{operation.command_name}}
- commandStartedEvent:
commandName: {{operation.command_name}}
- commandSucceededEvent:
commandName: {{operation.command_name}}
{%- if operation.operation_type == 'read' or operation.operation_name == "runCommand" %}
- description: '{{operation.object}}.{{operation.operation_name}} (read) does not retry if retryReads=false'
operations:
- name: failPoint
object: testRunner
arguments:
client: *internal_client
failPoint:
configureFailPoint: failCommand
mode: { times: 1 }
data:
failCommands: [{{operation.command_name}}]
errorLabels: [RetryableError, SystemOverloadedError]
errorCode: 2
- name: {{operation.operation_name}}
object: *{{operation.object}}_retryReads_false
{%- if operation.arguments|length > 0 %}
arguments:
{%- for arg in operation.arguments %}
{{arg}}
{%- endfor -%}
{%- endif %}
expectError:
isError: true
isClientError: false
expectEvents:
- client: *client_retryReads_false
events:
- commandStartedEvent:
commandName: {{operation.command_name}}
- commandFailedEvent:
commandName: {{operation.command_name}}
{%- endif %}
{%- if operation.operation_type == 'write' or operation.operation_name == "runCommand" %}
- description: '{{operation.object}}.{{operation.operation_name}} (write) does not retry if retryWrites=false' {%- if ((operation.operation_name == 'clientBulkWrite')) %}
runOnRequirements:
- minServerVersion: '8.0' # client bulk write added to server in 8.0
{%- endif %}
operations: {%- if operation.operation_name == "dropIndex" %}
- name: createIndex
object: *internal_collection
arguments:
keys: { x: 11 }
name: "x_11"
{%- endif %}
- name: failPoint
object: testRunner
arguments:
client: *internal_client
failPoint:
configureFailPoint: failCommand
mode: { times: 1 }
data:
failCommands: [{{operation.command_name}}]
errorLabels: [RetryableError, SystemOverloadedError]
errorCode: 2
- name: {{operation.operation_name}}
object: *{{operation.object}}_retryWrites_false
{%- if operation.arguments|length > 0 %}
arguments:
{%- for arg in operation.arguments %}
{{arg}}
{%- endfor -%}
{%- endif %}
expectError:
isError: true
isClientError: false
expectEvents:
- client: *client_retryWrites_false
events:
- commandStartedEvent:
commandName: {{operation.command_name}}
- commandFailedEvent:
commandName: {{operation.command_name}}
{%- endif %}
{% endfor -%}