@@ -21,6 +21,7 @@ const (
21
21
firstOptName = "first"
22
22
afterOptName = "after"
23
23
batchSizeOptName = "batch_size"
24
+ fetchLatestMetadataOptName = "fetch_latest_metadata"
24
25
)
25
26
26
27
// OptUint is an optional uint.
@@ -150,20 +151,26 @@ type SimpleOperationOpts struct {
150
151
Fields OptTuple
151
152
// BucketId is a bucket ID.
152
153
BucketId OptUint
154
+ // FetchLatestMetadata guarantees the up-to-date metadata (space format)
155
+ // in first return value, otherwise it may not take into account
156
+ // the latest migration of the data format. Performance overhead is up to 15%.
157
+ // Disabled by default.
158
+ FetchLatestMetadata OptBool
153
159
}
154
160
155
161
// EncodeMsgpack provides custom msgpack encoder.
156
162
func (opts SimpleOperationOpts ) EncodeMsgpack (enc * msgpack.Encoder ) error {
157
- const optsCnt = 4
163
+ const optsCnt = 5
158
164
159
165
names := [optsCnt ]string {timeoutOptName , vshardRouterOptName ,
160
- fieldsOptName , bucketIdOptName }
166
+ fieldsOptName , bucketIdOptName , fetchLatestMetadataOptName }
161
167
values := [optsCnt ]interface {}{}
162
168
exists := [optsCnt ]bool {}
163
169
values [0 ], exists [0 ] = opts .Timeout .Get ()
164
170
values [1 ], exists [1 ] = opts .VshardRouter .Get ()
165
171
values [2 ], exists [2 ] = opts .Fields .Get ()
166
172
values [3 ], exists [3 ] = opts .BucketId .Get ()
173
+ values [4 ], exists [4 ] = opts .FetchLatestMetadata .Get ()
167
174
168
175
return encodeOptions (enc , names [:], values [:], exists [:])
169
176
}
@@ -184,21 +191,28 @@ type SimpleOperationObjectOpts struct {
184
191
// SkipNullabilityCheckOnFlatten is a parameter to allow
185
192
// setting null values to non-nullable fields.
186
193
SkipNullabilityCheckOnFlatten OptBool
194
+ // FetchLatestMetadata guarantees the up-to-date metadata (space format)
195
+ // in first return value, otherwise it may not take into account
196
+ // the latest migration of the data format. Performance overhead is up to 15%.
197
+ // Disabled by default.
198
+ FetchLatestMetadata OptBool
187
199
}
188
200
189
201
// EncodeMsgpack provides custom msgpack encoder.
190
202
func (opts SimpleOperationObjectOpts ) EncodeMsgpack (enc * msgpack.Encoder ) error {
191
- const optsCnt = 5
203
+ const optsCnt = 6
192
204
193
205
names := [optsCnt ]string {timeoutOptName , vshardRouterOptName ,
194
- fieldsOptName , bucketIdOptName , skipNullabilityCheckOnFlattenOptName }
206
+ fieldsOptName , bucketIdOptName , skipNullabilityCheckOnFlattenOptName ,
207
+ fetchLatestMetadataOptName }
195
208
values := [optsCnt ]interface {}{}
196
209
exists := [optsCnt ]bool {}
197
210
values [0 ], exists [0 ] = opts .Timeout .Get ()
198
211
values [1 ], exists [1 ] = opts .VshardRouter .Get ()
199
212
values [2 ], exists [2 ] = opts .Fields .Get ()
200
213
values [3 ], exists [3 ] = opts .BucketId .Get ()
201
214
values [4 ], exists [4 ] = opts .SkipNullabilityCheckOnFlatten .Get ()
215
+ values [5 ], exists [5 ] = opts .FetchLatestMetadata .Get ()
202
216
203
217
return encodeOptions (enc , names [:], values [:], exists [:])
204
218
}
@@ -221,21 +235,28 @@ type OperationManyOpts struct {
221
235
// RollbackOnError is a parameter because of what any failed operation
222
236
// will lead to rollback on a storage, where the operation is failed.
223
237
RollbackOnError OptBool
238
+ // FetchLatestMetadata guarantees the up-to-date metadata (space format)
239
+ // in first return value, otherwise it may not take into account
240
+ // the latest migration of the data format. Performance overhead is up to 15%.
241
+ // Disabled by default.
242
+ FetchLatestMetadata OptBool
224
243
}
225
244
226
245
// EncodeMsgpack provides custom msgpack encoder.
227
246
func (opts OperationManyOpts ) EncodeMsgpack (enc * msgpack.Encoder ) error {
228
- const optsCnt = 5
247
+ const optsCnt = 6
229
248
230
249
names := [optsCnt ]string {timeoutOptName , vshardRouterOptName ,
231
- fieldsOptName , stopOnErrorOptName , rollbackOnErrorOptName }
250
+ fieldsOptName , stopOnErrorOptName , rollbackOnErrorOptName ,
251
+ fetchLatestMetadataOptName }
232
252
values := [optsCnt ]interface {}{}
233
253
exists := [optsCnt ]bool {}
234
254
values [0 ], exists [0 ] = opts .Timeout .Get ()
235
255
values [1 ], exists [1 ] = opts .VshardRouter .Get ()
236
256
values [2 ], exists [2 ] = opts .Fields .Get ()
237
257
values [3 ], exists [3 ] = opts .StopOnError .Get ()
238
258
values [4 ], exists [4 ] = opts .RollbackOnError .Get ()
259
+ values [5 ], exists [5 ] = opts .FetchLatestMetadata .Get ()
239
260
240
261
return encodeOptions (enc , names [:], values [:], exists [:])
241
262
}
@@ -261,15 +282,20 @@ type OperationObjectManyOpts struct {
261
282
// SkipNullabilityCheckOnFlatten is a parameter to allow
262
283
// setting null values to non-nullable fields.
263
284
SkipNullabilityCheckOnFlatten OptBool
285
+ // FetchLatestMetadata guarantees the up-to-date metadata (space format)
286
+ // in first return value, otherwise it may not take into account
287
+ // the latest migration of the data format. Performance overhead is up to 15%.
288
+ // Disabled by default.
289
+ FetchLatestMetadata OptBool
264
290
}
265
291
266
292
// EncodeMsgpack provides custom msgpack encoder.
267
293
func (opts OperationObjectManyOpts ) EncodeMsgpack (enc * msgpack.Encoder ) error {
268
- const optsCnt = 6
294
+ const optsCnt = 7
269
295
270
296
names := [optsCnt ]string {timeoutOptName , vshardRouterOptName ,
271
297
fieldsOptName , stopOnErrorOptName , rollbackOnErrorOptName ,
272
- skipNullabilityCheckOnFlattenOptName }
298
+ fetchLatestMetadataOptName }
273
299
values := [optsCnt ]interface {}{}
274
300
exists := [optsCnt ]bool {}
275
301
values [0 ], exists [0 ] = opts .Timeout .Get ()
@@ -278,6 +304,7 @@ func (opts OperationObjectManyOpts) EncodeMsgpack(enc *msgpack.Encoder) error {
278
304
values [3 ], exists [3 ] = opts .StopOnError .Get ()
279
305
values [4 ], exists [4 ] = opts .RollbackOnError .Get ()
280
306
values [5 ], exists [5 ] = opts .SkipNullabilityCheckOnFlatten .Get ()
307
+ values [6 ], exists [6 ] = opts .FetchLatestMetadata .Get ()
281
308
282
309
return encodeOptions (enc , names [:], values [:], exists [:])
283
310
}
@@ -292,18 +319,25 @@ type BorderOpts struct {
292
319
VshardRouter OptString
293
320
// Fields is field names for getting only a subset of fields.
294
321
Fields OptTuple
322
+ // FetchLatestMetadata guarantees the up-to-date metadata (space format)
323
+ // in first return value, otherwise it may not take into account
324
+ // the latest migration of the data format. Performance overhead is up to 15%.
325
+ // Disabled by default.
326
+ FetchLatestMetadata OptBool
295
327
}
296
328
297
329
// EncodeMsgpack provides custom msgpack encoder.
298
330
func (opts BorderOpts ) EncodeMsgpack (enc * msgpack.Encoder ) error {
299
- const optsCnt = 3
331
+ const optsCnt = 4
300
332
301
- names := [optsCnt ]string {timeoutOptName , vshardRouterOptName , fieldsOptName }
333
+ names := [optsCnt ]string {timeoutOptName , vshardRouterOptName , fieldsOptName ,
334
+ fetchLatestMetadataOptName }
302
335
values := [optsCnt ]interface {}{}
303
336
exists := [optsCnt ]bool {}
304
337
values [0 ], exists [0 ] = opts .Timeout .Get ()
305
338
values [1 ], exists [1 ] = opts .VshardRouter .Get ()
306
339
values [2 ], exists [2 ] = opts .Fields .Get ()
340
+ values [3 ], exists [3 ] = opts .FetchLatestMetadata .Get ()
307
341
308
342
return encodeOptions (enc , names [:], values [:], exists [:])
309
343
}
0 commit comments