Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions crates/adapters/src/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ use dbsp::circuit::metrics::{
DBSP_STEP_LATENCY_MICROSECONDS, FILES_CREATED, FILES_DELETED, TOTAL_LATE_RECORDS,
};
use dbsp::circuit::tokio::TOKIO;
use dbsp::circuit::{CheckpointCommitter, CircuitStorageConfig, DevTweaks, Mode};
use dbsp::circuit::{CheckpointCommitter, CircuitStorageConfig, Mode};
use dbsp::samply::{MARKER_BYTES, Markers, SamplySpan};
use dbsp::storage::backend::{StorageBackend, StoragePath};
use dbsp::utils::process_rss_bytes;
Expand Down Expand Up @@ -159,8 +159,8 @@ pub use feldera_types::config::{
RuntimeConfig, TransportConfig,
};
use feldera_types::config::{
DEFAULT_MAX_WORKER_BATCH_SIZE, FileBackendConfig, FtConfig, FtModel, OutputBufferConfig,
StorageBackendConfig, SyncConfig,
DEFAULT_MAX_WORKER_BATCH_SIZE, DevTweaks, FileBackendConfig, FtConfig, FtModel,
OutputBufferConfig, StorageBackendConfig, SyncConfig,
};
use feldera_types::constants::{STATE_FILE, STEPS_FILE};
use feldera_types::format::json::{JsonFlavor, JsonParserConfig, JsonUpdateFormat};
Expand Down Expand Up @@ -4390,7 +4390,10 @@ impl ControllerInit {
pipeline_config: &PipelineConfig,
storage: Option<CircuitStorageConfig>,
) -> Result<CircuitConfig, ControllerError> {
let dev_tweaks = DevTweaks::from_config(&pipeline_config.global.dev_tweaks);
let dev_tweaks = pipeline_config.global.dev_tweaks.clone();
if dev_tweaks != DevTweaks::default() {
info!("using non-default `dev_tweaks`: {dev_tweaks:#?}")
}

let mut max_rss_mb = pipeline_config.global.max_rss_mb;

Expand Down
8 changes: 1 addition & 7 deletions crates/adapters/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -625,13 +625,7 @@ pub fn run_server(

// Install stack overflow handler early, before creating the controller and parsing DevTweaks.
#[cfg(target_family = "unix")]
if config
.global
.dev_tweaks
.get("stack_overflow_backtrace")
.cloned()
== Some(serde_json::Value::Bool(true))
{
if config.global.dev_tweaks.stack_overflow_backtrace() {
unsafe {
use crate::server::stack_overflow_backtrace::enable_stack_overflow_backtrace_with_limit;

Expand Down
4 changes: 2 additions & 2 deletions crates/adapters/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ pub(crate) fn run_in_posix_runtime<F>(
F: FnOnce() + Send + 'static,
{
use dbsp::Runtime;
use dbsp::circuit::{CircuitConfig, CircuitStorageConfig, DevTweaks, Layout, Mode};
use dbsp::circuit::{CircuitConfig, CircuitStorageConfig, Layout, Mode};
use feldera_types::config::{StorageCacheConfig, StorageConfig, StorageOptions};
use std::sync::{Arc, Mutex};

Expand All @@ -742,7 +742,7 @@ pub(crate) fn run_in_posix_runtime<F>(
)
.expect("failed to configure storage"),
),
dev_tweaks: DevTweaks::default(),
dev_tweaks: Default::default(),
};

let test_fn: Arc<Mutex<Option<F>>> = Arc::new(Mutex::new(Some(test_fn)));
Expand Down
1 change: 1 addition & 0 deletions crates/buffer-cache/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ description = "Weighted in-memory buffer caches with LRU and S3-FIFO eviction"
[dependencies]
crossbeam-utils = { workspace = true }
enum-map = { workspace = true }
feldera-types = { workspace = true }
quick_cache = { workspace = true }
serde = { workspace = true, features = ["derive"] }
tracing = { workspace = true }
Expand Down
29 changes: 1 addition & 28 deletions crates/buffer-cache/src/builder.rs
Original file line number Diff line number Diff line change
@@ -1,39 +1,12 @@
use crate::ThreadType;
use crate::{CacheEntry, LruCache, S3FifoCache, SharedBufferCache};
use enum_map::{Enum, EnumMap};
use serde::{Deserialize, Serialize};
use feldera_types::config::dev_tweaks::{BufferCacheAllocationStrategy, BufferCacheStrategy};
use std::fmt::Debug;
use std::hash::{BuildHasher, Hash, RandomState};
use std::marker::PhantomData;
use tracing::warn;

/// Selects which eviction strategy backs a cache instance.
#[derive(Copy, Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum BufferCacheStrategy {
/// Use the sharded S3-FIFO cache backed by `quick_cache`.
#[default]
S3Fifo,

/// Use the mutex-protected weighted LRU cache.
Lru,
}

/// Controls how caches are shared across a foreground/background worker pair.
#[derive(Copy, Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum BufferCacheAllocationStrategy {
/// Share one cache across a foreground/background worker pair.
#[default]
SharedPerWorkerPair,

/// Create a separate cache for each foreground/background thread.
PerThread,

/// Share one cache across all foreground/background threads.
Global,
}

/// Builds the cache layout used by DBSP runtime worker pairs.
pub struct BufferCacheBuilder<K, V, S = RandomState> {
/// Eviction strategy used for newly constructed caches.
Expand Down
3 changes: 2 additions & 1 deletion crates/buffer-cache/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ mod thread_type;
use std::any::Any;
use std::sync::Arc;

pub use builder::{BufferCacheAllocationStrategy, BufferCacheBuilder, BufferCacheStrategy};
pub use builder::BufferCacheBuilder;
use feldera_types::config::dev_tweaks::BufferCacheStrategy;
pub use lru::LruCache;
pub use s3_fifo::S3FifoCache;
pub use thread_type::ThreadType;
Expand Down
4 changes: 3 additions & 1 deletion crates/buffer-cache/src/lru.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use crate::{BufferCache, BufferCacheStrategy, CacheEntry};
use feldera_types::config::dev_tweaks::BufferCacheStrategy;

use crate::{BufferCache, CacheEntry};
use std::any::Any;
use std::collections::BTreeMap;
use std::fmt::Debug;
Expand Down
3 changes: 2 additions & 1 deletion crates/buffer-cache/src/s3_fifo.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::{BufferCache, BufferCacheStrategy, CacheEntry};
use crate::{BufferCache, CacheEntry};
use feldera_types::config::dev_tweaks::BufferCacheStrategy;
use quick_cache::{OptionsBuilder, Weighter, sync::Cache as QuickCache};
use std::any::Any;
use std::hash::{BuildHasher, Hash, RandomState};
Expand Down
6 changes: 3 additions & 3 deletions crates/buffer-cache/src/tests/builder.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{
BufferCacheAllocationStrategy, BufferCacheBuilder, BufferCacheStrategy, CacheEntry, ThreadType,
};
use feldera_types::config::dev_tweaks::{BufferCacheAllocationStrategy, BufferCacheStrategy};

use crate::{BufferCacheBuilder, CacheEntry, ThreadType};
use std::sync::Arc;

#[derive(Clone)]
Expand Down
4 changes: 2 additions & 2 deletions crates/dbsp/benches/cursor_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//!
//! Run with: cargo bench -p dbsp --bench cursor_list

use dbsp::circuit::{CircuitConfig, CircuitStorageConfig, DevTweaks, Layout, Mode};
use dbsp::circuit::{CircuitConfig, CircuitStorageConfig, Layout, Mode};
use dbsp::{
OrdIndexedZSet, Runtime, ZWeight,
trace::cursor::CursorList,
Expand Down Expand Up @@ -102,7 +102,7 @@ fn bench(storage: bool) {
)
.expect("failed to configure POSIX storage"),
),
dev_tweaks: DevTweaks::default(),
dev_tweaks: Default::default(),
};

let results: Arc<Mutex<Vec<BenchResult>>> = Arc::new(Mutex::new(Vec::new()));
Expand Down
4 changes: 2 additions & 2 deletions crates/dbsp/benches/input_map_ingest.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use anyhow::{Context, Result, anyhow};
use crossbeam::channel::{Sender, bounded};
use dbsp::circuit::{CircuitConfig, CircuitStorageConfig, DevTweaks, Layout, Mode};
use dbsp::circuit::{CircuitConfig, CircuitStorageConfig, Layout, Mode};
use dbsp::{
Runtime,
mimalloc::MiMalloc,
Expand Down Expand Up @@ -54,7 +54,7 @@ fn main() -> Result<()> {
)
.context("failed to configure POSIX storage backend")?,
),
dev_tweaks: DevTweaks::default(),
dev_tweaks: Default::default(),
};

let total_batches = (TOTAL_RECORDS / BATCH_SIZE as u64) as usize;
Expand Down
4 changes: 2 additions & 2 deletions crates/dbsp/benches/list_merger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//!
//! Run with: `cargo bench -p dbsp --bench list_merger`

use dbsp::circuit::{CircuitConfig, CircuitStorageConfig, DevTweaks, Layout, Mode};
use dbsp::circuit::{CircuitConfig, CircuitStorageConfig, Layout, Mode};
use dbsp::{
OrdIndexedZSet, Runtime, ZWeight,
trace::{Batch as DynBatch, BatchLocation, BatchReader as DynBatchReader, Builder, ListMerger},
Expand Down Expand Up @@ -125,7 +125,7 @@ fn bench(generate_on_storage: bool) {
)
.expect("failed to configure POSIX storage"),
),
dev_tweaks: DevTweaks::default(),
dev_tweaks: Default::default(),
};

let results: Arc<Mutex<Vec<BenchResult>>> = Arc::new(Mutex::new(Vec::new()));
Expand Down
2 changes: 1 addition & 1 deletion crates/dbsp/src/circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub use circuit_builder::{
NestedCircuit, NodeId, OwnershipPreference, RootCircuit, Scope, Stream, WithClock,
};
pub use dbsp_handle::{
CheckpointCommitter, CircuitConfig, CircuitStorageConfig, DBSPHandle, DevTweaks, Host, Layout,
CheckpointCommitter, CircuitConfig, CircuitStorageConfig, DBSPHandle, Host, Layout,
LayoutError, Mode, StorageCacheConfig, StorageConfig, StorageOptions, adaptive_joins_enabled,
balancer_balance_tax, balancer_key_distribution_refresh_threshold,
balancer_min_absolute_improvement_threshold, balancer_min_relative_improvement_threshold,
Expand Down
Loading
Loading