@@ -25,7 +25,7 @@ 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_THROUGHPUT_LIMIT ;
28
+ use quickwit_common:: shared_consts:: { DEFAULT_SHARD_BURST_LIMIT , DEFAULT_SHARD_THROUGHPUT_LIMIT } ;
29
29
use quickwit_common:: uri:: Uri ;
30
30
use quickwit_proto:: indexing:: CpuCapacity ;
31
31
use quickwit_proto:: types:: NodeId ;
@@ -341,11 +341,16 @@ impl SearcherConfig {
341
341
#[ derive( Clone , Debug , Eq , PartialEq , Serialize , Deserialize ) ]
342
342
#[ serde( deny_unknown_fields, default ) ]
343
343
pub struct IngestApiConfig {
344
+ /// Maximum memory space taken by the ingest WAL
344
345
pub max_queue_memory_usage : ByteSize ,
346
+ /// Maximum disk space taken by the ingest WAL
345
347
pub max_queue_disk_usage : ByteSize ,
346
348
replication_factor : usize ,
347
349
pub content_length_limit : ByteSize ,
350
+ /// [hidden] Targeted throughput for each shard
348
351
pub shard_throughput_limit : ByteSize ,
352
+ /// [hidden] Targeted throughput for each shard
353
+ pub shard_burst_limit : ByteSize ,
349
354
}
350
355
351
356
impl Default for IngestApiConfig {
@@ -356,6 +361,7 @@ impl Default for IngestApiConfig {
356
361
replication_factor : 1 ,
357
362
content_length_limit : ByteSize :: mib ( 10 ) ,
358
363
shard_throughput_limit : DEFAULT_SHARD_THROUGHPUT_LIMIT ,
364
+ shard_burst_limit : DEFAULT_SHARD_BURST_LIMIT ,
359
365
}
360
366
}
361
367
}
@@ -407,6 +413,15 @@ impl IngestApiConfig {
407
413
"shard_throughput_limit ({:?}) must be within 1mb and 20mb" ,
408
414
self . shard_throughput_limit
409
415
) ;
416
+ // The newline delimited format is persisted as something a bit larger
417
+ // (lines prefixed with their length)
418
+ let estimated_persist_size = ByteSize :: b ( 3 * self . content_length_limit . as_u64 ( ) / 2 ) ;
419
+ ensure ! (
420
+ self . shard_burst_limit >= estimated_persist_size,
421
+ "shard_burst_limit ({:?}) must be at least 1.5*content_length_limit ({:?})" ,
422
+ self . shard_burst_limit,
423
+ estimated_persist_size,
424
+ ) ;
410
425
Ok ( ( ) )
411
426
}
412
427
}
0 commit comments