@@ -25,7 +25,10 @@ use anyhow::{bail, ensure};
25
25
use bytesize:: ByteSize ;
26
26
use http:: HeaderMap ;
27
27
use quickwit_common:: net:: HostAddr ;
28
- use quickwit_common:: shared_consts:: { DEFAULT_SHARD_BURST_LIMIT , DEFAULT_SHARD_THROUGHPUT_LIMIT } ;
28
+ use quickwit_common:: shared_consts:: {
29
+ DEFAULT_SHARD_BURST_LIMIT , DEFAULT_SHARD_SCALE_UP_FACTOR , DEFAULT_SHARD_THROUGHPUT_LIMIT ,
30
+ MAX_SHARD_SCALE_UP_FACTOR ,
31
+ } ;
29
32
use quickwit_common:: uri:: Uri ;
30
33
use quickwit_proto:: indexing:: CpuCapacity ;
31
34
use quickwit_proto:: types:: NodeId ;
@@ -39,7 +42,7 @@ use crate::{ConfigFormat, MetastoreConfigs};
39
42
40
43
pub const DEFAULT_QW_CONFIG_PATH : & str = "config/quickwit.yaml" ;
41
44
42
- #[ derive( Clone , Debug , Eq , PartialEq , Serialize , Deserialize ) ]
45
+ #[ derive( Clone , Debug , PartialEq , Serialize , Deserialize ) ]
43
46
#[ serde( deny_unknown_fields) ]
44
47
pub struct RestConfig {
45
48
pub listen_addr : SocketAddr ,
@@ -50,7 +53,7 @@ pub struct RestConfig {
50
53
pub tls : Option < TlsConfig > ,
51
54
}
52
55
53
- #[ derive( Clone , Debug , Eq , PartialEq , Serialize , Deserialize ) ]
56
+ #[ derive( Clone , Debug , PartialEq , Serialize , Deserialize ) ]
54
57
#[ serde( deny_unknown_fields) ]
55
58
pub struct GrpcConfig {
56
59
#[ serde( default = "GrpcConfig::default_max_message_size" ) ]
@@ -83,7 +86,7 @@ impl Default for GrpcConfig {
83
86
}
84
87
}
85
88
86
- #[ derive( Clone , Debug , Eq , PartialEq , Serialize , Deserialize ) ]
89
+ #[ derive( Clone , Debug , PartialEq , Serialize , Deserialize ) ]
87
90
#[ serde( deny_unknown_fields) ]
88
91
pub struct TlsConfig {
89
92
pub cert_path : String ,
@@ -193,7 +196,7 @@ impl Default for IndexerConfig {
193
196
}
194
197
}
195
198
196
- #[ derive( Debug , Clone , Copy , Eq , PartialEq , Serialize , Deserialize ) ]
199
+ #[ derive( Debug , Clone , Copy , PartialEq , Serialize , Deserialize ) ]
197
200
#[ serde( deny_unknown_fields) ]
198
201
pub struct SplitCacheLimits {
199
202
pub max_num_bytes : ByteSize ,
@@ -219,7 +222,7 @@ impl SplitCacheLimits {
219
222
}
220
223
}
221
224
222
- #[ derive( Clone , Debug , Eq , PartialEq , Serialize , Deserialize ) ]
225
+ #[ derive( Clone , Debug , PartialEq , Serialize , Deserialize ) ]
223
226
#[ serde( deny_unknown_fields, default ) ]
224
227
pub struct SearcherConfig {
225
228
pub aggregation_memory_limit : ByteSize ,
@@ -254,7 +257,7 @@ pub struct SearcherConfig {
254
257
/// This policy is inspired by this guidance. It does not track instanteneous throughput, but
255
258
/// computes an overall timeout using the following formula:
256
259
/// `timeout_offset + num_bytes_get_request / min_throughtput`
257
- #[ derive( Clone , Debug , Eq , PartialEq , Serialize , Deserialize ) ]
260
+ #[ derive( Clone , Debug , PartialEq , Serialize , Deserialize ) ]
258
261
pub struct StorageTimeoutPolicy {
259
262
pub min_throughtput_bytes_per_secs : u64 ,
260
263
pub timeout_millis : u64 ,
@@ -338,7 +341,7 @@ impl SearcherConfig {
338
341
}
339
342
}
340
343
341
- #[ derive( Clone , Debug , Eq , PartialEq , Serialize , Deserialize ) ]
344
+ #[ derive( Clone , Debug , PartialEq , Serialize , Deserialize ) ]
342
345
#[ serde( deny_unknown_fields, default ) ]
343
346
pub struct IngestApiConfig {
344
347
/// Maximum memory space taken by the ingest WAL
@@ -347,10 +350,12 @@ pub struct IngestApiConfig {
347
350
pub max_queue_disk_usage : ByteSize ,
348
351
replication_factor : usize ,
349
352
pub content_length_limit : ByteSize ,
350
- /// [ hidden] Targeted throughput for each shard
353
+ /// ( hidden) Targeted throughput for each shard
351
354
pub shard_throughput_limit : ByteSize ,
352
- /// [ hidden] Targeted throughput for each shard
355
+ /// ( hidden) Targeted throughput for each shard
353
356
pub shard_burst_limit : ByteSize ,
357
+ /// (hidden) new_shard_count = ceil(old_shard_count * shard_scaling_factor)
358
+ pub shard_scale_up_factor : f32 ,
354
359
}
355
360
356
361
impl Default for IngestApiConfig {
@@ -362,6 +367,7 @@ impl Default for IngestApiConfig {
362
367
content_length_limit : ByteSize :: mib ( 10 ) ,
363
368
shard_throughput_limit : DEFAULT_SHARD_THROUGHPUT_LIMIT ,
364
369
shard_burst_limit : DEFAULT_SHARD_BURST_LIMIT ,
370
+ shard_scale_up_factor : DEFAULT_SHARD_SCALE_UP_FACTOR ,
365
371
}
366
372
}
367
373
}
@@ -422,11 +428,18 @@ impl IngestApiConfig {
422
428
self . shard_burst_limit,
423
429
estimated_persist_size,
424
430
) ;
431
+ ensure ! (
432
+ self . shard_scale_up_factor > 1.0
433
+ && self . shard_scale_up_factor <= MAX_SHARD_SCALE_UP_FACTOR ,
434
+ "shard_scale_up_factor ({:?}) must be in the (1,{}) interval" ,
435
+ self . shard_scale_up_factor,
436
+ MAX_SHARD_SCALE_UP_FACTOR ,
437
+ ) ;
425
438
Ok ( ( ) )
426
439
}
427
440
}
428
441
429
- #[ derive( Clone , Debug , Eq , PartialEq , Serialize , Deserialize ) ]
442
+ #[ derive( Clone , Debug , PartialEq , Serialize , Deserialize ) ]
430
443
#[ serde( deny_unknown_fields) ]
431
444
pub struct JaegerConfig {
432
445
/// Enables the gRPC endpoint that allows the Jaeger Query Service to connect and retrieve
0 commit comments