Repository navigation
perf: Phase 1–3 low-level ingest, OTLP, Parquet query, caching & connector optimizations - #195
Merged
Merged
Conversation
…ON len, and fix ingest/range-read gaps
…er flatten, cache num_cpus
- Eliminate serde_json::Deserializer round-trips for Float64 (direct zmij formatting when guaranteed bit-identical to legacy non-roundtrip parsing, keeping exact NaN/Inf/-0.0 and Float16/Float32 fallback) and pure-ASCII naive Timestamp(_, None) columns in QueryResponse. - Downgrade per-batch 'Returning query results' logs in response.rs to tracing::debug! while keeping a single top-level info! log for non-streaming queries. - Replace the 4-hop record_batches_to_json round-trip in /counts with direct typed Arrow column reads. - Replace record_batches_to_json in PromQL group_rows and discover_labels with direct typed Arrow column reads and handle sliced StringViewArray/BinaryViewArray compaction and shared buffer deduplication in PromQL's 64 MiB batch admission check. - Fix local send_null parity in traces.rs and read duplicate_anchor_count directly from Arrow in query_context.rs.
…ic/arrow-flight to tls-ring
…nd harden reader/writer invariants
…onto JsonBytes + flat fast path
Check cached timestamp values and indexed IPC slice bounds against the default partition window. Keep residual filters and forward their batches directly to progressive TopK. Compact sparse Utf8View and BinaryView payloads after selecting winners so discarded buffers do not exhaust the merge reservation.
…ass SWAR + Clinger decimal scanner
…and sequential small-batch guards
…ve tuple check in compatibility.py
…ad memory budget S3 and the GCS XML API reject part numbers above 10,000, but every backend uploaded in parts of exactly P_MULTIPART_MIN_SIZE. A file larger than 10,000 parts (over 160 GiB at the 16 MiB default) failed at part 10,001, was aborted, and was retried from staging forever. - multipart_part_size raises the part size just enough to fit 10,000 parts, within per-store limits (S3/GCS: 5 GiB parts and 5 TiB objects; Azure: 4,000 MiB blocks). A file larger than a store accepts is refused before the upload is created. upload_file_parts applies the same 10,000-part raise as a second guard. - A raised part that would also exceed P_MAX_UPLOAD_MEMORY_BYTES is refused before anything is buffered, and the error names the budget to set. A configured part size above the budget keeps its old behaviour. - UploadBuffering::payload_bytes reserves the raised part size, so the memory budget covers what the upload actually allocates. - Azure caps its single-PUT threshold and base block size at 4,000 MiB, so a 4,000-5,120 MiB file is no longer sent as one Put Blob over Azure's 5,000 MiB limit. Its upload_buffering reports the same size. - --min-multipart-size / P_MULTIPART_MIN_SIZE is bounded to 5 MiB..=5 GiB. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ng, and isolate partition failures/backpressure
… records directly Each resource and scope level is now read in a single pass that merges its singular fields as prost does and keeps child references (prefix, content start, content end) instead of a field pass followed by a children pass. References are capped (1024 scopes, 2048 records, 12 B each) so a walk still holds under 64 KiB; children past the cap are found by a second pass over the rest of the level. `outline` only counts records per scope. Log records are decoded straight from their wire bytes into one reused LogRecord (src/otel/wire.rs). Any unusual or broken encoding (wrong wire type, group, oneof switch, duplicate message field, invalid UTF-8, bad varint, nesting past 24 AnyValue levels) falls back to prost into a fresh record, so errors stay byte-identical. The size cap is still checked first, and the reused record is dropped once it retains over 64 KiB. Adds differential tests against whole-request prost decoding: malformed wire at every level, recursion limits (array nesting 47/48, groups 100/99/98/97), late partial success, duplicate singulars, oneof switches, fallback freshness, empty and over-cap batches, and exhaustive cut/damage. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e policy Warm scans no longer deep-clone every File/Column of shared manifests. collect_from_snapshot_cached now returns SelectedManifestFiles: the loaded Arc<Option<Manifest>> handles plus newest-first (manifest, file) indices, pruned (sequential below 2,048 files / 250k columns, ordered Rayon above) and truncated for LIMIT exactly as before. Scan planning borrows &File through a ScanFile trait (balanced groups, partitioned files, interior split, manifest row count), copying only each PartitionedFile path. Only streams with a hot tier copy their post-prune selection, because HotTierManager classifies owned files; collect_from_snapshot clones only surviving shared entries and moves entries out of unshared manifests. The `object_store_url == "file:///"` check is replaced by ParquetCachePolicy, classified from the planner path (ParquetScanSource: Staging, HotTier, Published) and URL: staging leases are Bypass, hot tier and published LocalFS files are LocalImmutable(origin), other stores are Remote. Server cache settings are read only for cacheable scans. local_immutable_cache_enabled keeps both local origins uncached, so behaviour is unchanged until the local cache is wired in. parquet_scan_plan_with_cache_options keeps its tuple signature for tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…at 64B, and defer dict-cast unwrap
…alImmutable, and S1-S7 fixes
…d manifests, and DecodedManifestCache pressure relief
…anifestTable::scan
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements Phases 1–3 of low-level performance, caching, and durability optimizations across ingest, OTLP, Parquet querying, metastore caching, object-storage multipart uploads, Kafka ingestion, and HotTier management — preserving 100% Parseable API, SQL, OTLP, JSON, PromQL, Flight, and crash-recovery compatibility.
Highlights
x86-64-v3, ARMv8+outline-atomics,apple-m1) release targets, Fat LTO Dockerfiles (205.0 MB → 130.3 MB,-36.4%), auto-selectingscripts/download.sh, opt-in PGO hooks, and switchingarrow-flight/tonictotls-ring.unsafe8-byte SWAR + Clinger decimal flat JSON scanner (src/utils/json/strict.rs), off-workerJsonBytesdecompression fix (HTTP400 → 200on gzip/zstd/br) +/api/v1/logstream/{stream}fast path, native numericfield_stats, packedu128/u64log clustering sort, coalesced 256 KiB staging IPC reads, andFutexWorkerPooleliminating Rayonsched_yieldstorms (-99.98%+) with panic logging.LogRecordwire decoder (src/otel/wire.rs,src/otel/protobuf_stream.rs) with byte-identicalprosterror/recursion fallback.DeserializeSeedvisitor (src/otel/json_fast.rs,-84.2%allocations on 512-record batches).RecordBatchbuilders for OTLP Logs, Metrics (includingListbuilders and bit-exact__series_hash_u64), and Traces (direct hex ID writes) wired intoingest_utils.rs.Utf8ViewParquet scans + recursive Flight wire materialization, Unicode-sound SIMD/SWAR compiledILIKEpredicate pushdown, and certified interior staging elision in Progressive TopK.RowSelectionlate materialization for eligible local Progressive TopK scans (src/query/ordered_topk.rs) with object-version +RowNumbertracking and single-pass remote/certified guards.SelectedManifestFilesand explicitParquetCachePolicy(Bypass/Remote/LocalImmutable) insrc/query/stream_schema_provider.rs.xxh3O(1) slab-indexedsmall_file_cachewith boundOnceCell<Arc<ParquetMetaData>>(PageIndexPolicy::Optional),LocalImmutable+ no-ctimestat validator, 256-FD-cappedPinnedLocalFileReader, synchronouslocalfs.rspublication invalidation, and S1–S7 fixes.DecodedManifestCache(PostgreSQL conditional body skip, LocalFS FD-fingerprinted & Cloud ETag decode skip) wired end-to-end with*_sharedmanifest reads andrun_soft_pressure_relief().P_MAX_UPLOAD_MEMORY_BYTESpre-allocation refusal, 4,000 MiB Azure single-PUT/buffering alignment, and--min-multipart-sizebounds.ConsumerConfigflags (fixingfetch.wait.max.msandmax.partition.fetch.bytes/fetch.message.max.bytesalias collision),(partition, minute)Arrow batching, transientArrowError::IoError/IpcErrordurability, and DekkerSeqCstper-partition backpressure/failure isolation.Measured Benchmarks (Pinned 4-CPU Server
0-3vs 4-CPU Client4-7, Basebc4c6c79→ Phase 3a290ffbe)bc4c6c79)818a4fa3)a290ffbe)query_range(10k samples)/api/v1/logstreamflat JSON/v1/logs)/v1/logs)/v1/traces)ILIKE/api/v1/ingestWHERE =)LIMIT 50)wide32_lat)syscrsyscrVerification
cargo test --offline --locked --lib: 2,322 passed, 0 failedcargo test --offline --locked --features kafka --lib -- connectors::kafka: 91 passed, 0 failedcargo clippy --offline --locked --lib -- -D warnings(default +--features kafka): 0 warningsrustfmt --edition 2024 --check: clean across all modified filesscripts/ingest-performance/compatibility.py(baselinebc4c6c79vs candidatea290ffbe): 21/21 scenarios identicalscripts/test-download.py(10/10) andscripts/ingest-performanceunit tests (22/22) passingOpen in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.