@@ -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 ;
@@ -323,11 +323,16 @@ impl SearcherConfig {
323
323
#[ derive( Clone , Debug , Eq , PartialEq , Serialize , Deserialize ) ]
324
324
#[ serde( deny_unknown_fields, default ) ]
325
325
pub struct IngestApiConfig {
326
+ /// Maximum memory space taken by the ingest WAL
326
327
pub max_queue_memory_usage : ByteSize ,
328
+ /// Maximum disk space taken by the ingest WAL
327
329
pub max_queue_disk_usage : ByteSize ,
328
330
replication_factor : usize ,
329
331
pub content_length_limit : ByteSize ,
332
+ /// [hidden] Targeted throughput for each shard
330
333
pub shard_throughput_limit : ByteSize ,
334
+ /// [hidden] Targeted throughput for each shard
335
+ pub shard_burst_limit : ByteSize ,
331
336
}
332
337
333
338
impl Default for IngestApiConfig {
@@ -338,6 +343,7 @@ impl Default for IngestApiConfig {
338
343
replication_factor : 1 ,
339
344
content_length_limit : ByteSize :: mib ( 10 ) ,
340
345
shard_throughput_limit : DEFAULT_SHARD_THROUGHPUT_LIMIT ,
346
+ shard_burst_limit : DEFAULT_SHARD_BURST_LIMIT ,
341
347
}
342
348
}
343
349
}
@@ -389,6 +395,15 @@ impl IngestApiConfig {
389
395
"shard_throughput_limit ({:?}) must be within 1mb and 20mb" ,
390
396
self . shard_throughput_limit
391
397
) ;
398
+ // The newline delimited format is persisted as something a bit larger
399
+ // (lines prefixed with their length)
400
+ let estimated_persist_size = ByteSize :: b ( 3 * self . content_length_limit . as_u64 ( ) / 2 ) ;
401
+ ensure ! (
402
+ self . shard_burst_limit >= estimated_persist_size,
403
+ "shard_burst_limit ({:?}) must be at least 1.5*content_length_limit ({:?})" ,
404
+ self . shard_burst_limit,
405
+ estimated_persist_size,
406
+ ) ;
392
407
Ok ( ( ) )
393
408
}
394
409
}
0 commit comments