Commit Graph
5294 Commits
Author SHA1 Message Date
discord9 cfb66f5f2e chore: synchronize raw frame stream stack base
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-15 18:23:37 +08:00
discord9 489c9453cd chore: synchronize series frame stack base
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-15 18:22:41 +08:00
discord9 380fde19df chore: synchronize merged histogram foundations
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-15 18:21:36 +08:00
discord9 1164877b5a chore: synchronize merged series samples
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-15 18:18:18 +08:00
discord9 ad1d1ee0fb refactor(datatypes): share series time validation
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-15 18:15:01 +08:00
discord9 70a6c4551f refactor(query): share native histogram bucket assembly
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-15 18:14:47 +08:00
discord9 44b3022a73 chore: synchronize merged series foundation
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-15 18:08:39 +08:00
discord9 bdc12034e5 fix(datatypes): address series foundation review feedback
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-15 17:56:57 +08:00
discord9 696259a1ce feat(query): add incremental raw series frame streams
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-15 17:16:16 +08:00
discord9 3717cc2e2a fix(datatypes): retain histogram table views across frame densification
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-15 16:31:56 +08:00
discord9 cdca81ed9e chore: sync reviewed series foundation fixes
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-15 15:37:25 +08:00
discord9 69c73740ec feat(datatypes): add raw series frame codec
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-15 15:35:59 +08:00
discord9 4f0cc3244a chore: sync histogram-only densification fix
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-15 14:47:37 +08:00
discord9 4769ddd939 chore: sync histogram-only densification fix
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-15 14:46:17 +08:00
discord9 cb0a75f2c0 fix(datatypes): skip float buffers for histogram-only densification
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-15 14:45:36 +08:00
discord9 bb84af91a8 chore: sync reviewed series test cleanup
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-15 14:34:16 +08:00
discord9 57e1c51eb5 chore: sync reviewed series test cleanup
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-15 14:33:24 +08:00
discord9 1bfef429e7 chore: sync reviewed foundation test cleanup
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-15 14:30:55 +08:00
discord9 10dd49564a test(series): assert densification values without table layout
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-15 14:29:58 +08:00
discord9 78e94ced92 test(series): clarify histogram nullable-item schema coverage
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-15 14:29:45 +08:00
discord9 8d0278876d Merge commit '971e1893973233332b51201c67bfcdab8b556dea' into feat/narthex-raw-contract
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-15 13:38:50 +08:00
discord9 971e189397 Merge commit '4ca29e88b12c07d0a0e623043afe8dd296db6468' into feat/narthex-borrowed-histogram
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-15 13:37:58 +08:00
discord9 4ca29e88b1 fix(datatypes): retain shared histogram tables when densifying
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-15 13:36:48 +08:00
discord9 a8bb74cbf9 feat(storage): define raw series and optional scanner contract
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-15 13:32:32 +08:00
discord9 9a4d53ea64 feat(query): normalize stored histograms into shared samples
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-15 13:08:24 +08:00
discord9 295fc8cfb8 Merge branch 'feat/narthex-series-samples' into feat/narthex-borrowed-histogram
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-15 12:52:02 +08:00
discord9 7e5acfb9a9 fix(datatypes): size dense sample buffers to the local result
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-15 12:51:54 +08:00
discord9 d632c062f4 Merge branch 'feat/narthex-series-foundation' into feat/narthex-series-samples
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-15 12:47:45 +08:00
discord9 bee536ff27 feat(datatypes): add shared native series samples and fields
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-15 12:47:45 +08:00
discord9 d9d8dfff68 feat(query): estimate quantiles from borrowed histogram views
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-15 12:41:56 +08:00
discord9 a6cdbf966b fix(datatypes): avoid oversized default histogram buffers
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-15 12:41:47 +08:00
discord9 e8f76480d8 test(datatypes): remove duplicate absent-label lookup assertion
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-15 12:22:56 +08:00
discord9 ab1ee752d6 refactor(datatypes): use standard series test module layout
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-15 12:19:28 +08:00
discord9 fbf5f0c544 feat(datatypes): add Narthex shared series identity and time foundations
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-15 12:07:03 +08:00
Lei, HUANG 3b442adba2 feat(mito): decouple compaction unit execution and publication (#9131)
* feat(mito): decouple compaction unit execution and publication

Execute shared-input dependency groups as independent local compaction units. Publish and acknowledge each unit separately, retain successful sibling results, and release each unit's input leases after worker apply.

Preserve picker priority, panic notifications, snapshot-free execution context, and indexed input leases. Include regression coverage for independent visibility, purge, cancellation, partial failure, and restart recovery.

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>

* refactor(mito): use crate visibility for compaction unit items

Replace the newly introduced pub(super) declarations with pub(crate), and make CompactingFiles::try_reserve private since it is only used within its module, per docs/style-guide.md.

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>

* refactor(mito): simplify compaction unit state and test fixtures

Keep local input leases in the task and derive running units from tracked and pending work. Replace the single-implementation task trait with an inherent async method and align exposed state type visibility.

Use snapshot-free region fixtures and named test scenarios, and cover independent input purging across three units with bounded parallelism.

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>

* refactor(mito): align compaction task and test module names

Rename CompactionTaskImpl to CompactionTask now that the CompactionTask
trait has been removed and the Impl suffix no longer marks a trait
implementation. Rename the state test module from lease_tests to tests
to follow the test module naming convention.

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>

* refactor(mito): align compaction task debug label

The Debug impl reported "TwcsCompactionTask" while the type is now
CompactionTask. Report the type name for consistency.

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>

* refactor(mito): label compaction elapsed metric per published unit

Record greptime_mito_compaction_total_elapsed once per published unit and
label it by type: a local dependency unit or a remote job. Update the
metric docs and group the Grafana compaction OPS/latency panels by type.

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>

* docs(mito): clarify compacting file lease sharing

`CompactingFiles::for_inputs` clones the shared per-file leases instead of
transferring them. Document that the original collection keeps its leases,
so an input is released only after every owner drops its lease.

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>

* docs(mito): document local compaction unit map key

Document that `LocalCompaction::units` is keyed by each unit's execution
plan ID, which matches `CompactionExecution::plan_id()` and the `plan_id`
carried by unit notifications.

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>

* refactor(mito): rename submit_prepared_compaction

The function submits remote jobs but only prepares local unit tasks; the
caller dispatches them after installing the returned phase. Rename it to
`prepare_or_submit_compaction` and document that ordering.

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>

---------

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
2026-10-14 12:21:32 +00:00
fengyue-xve a35661d69c fix(hdfs): clean up temporary file when an atomic write fails (#9483)
* fix(hdfs): clean up temporary file when an atomic write fails

Signed-off-by: fengyue-xve <1759519137@qq.com>

* style: apply rustfmt to hdfs layer test

Signed-off-by: fengyue-xve <1759519137@qq.com>

* fix(hdfs): report earlier write failures and log cleanup failures

- Later `write`/`close` calls on a writer whose failed write was
  cleaned up now mention the original failure instead of the bare
  "unavailable after close or abort" message.
- `abort_and_delete` logs abort and deletion failures with the
  temporary path instead of discarding them; the original write error
  is still returned to the caller.
- The temporary-file cleanup test now lists the directory holding the
  temporary file, so it fails if the cleanup is reverted.

Signed-off-by: 风月 <1759519137@qq.com>
Signed-off-by: fengyue-xve <1759519137@qq.com>

---------

Signed-off-by: fengyue-xve <1759519137@qq.com>
Signed-off-by: 风月 <1759519137@qq.com>
2026-10-14 09:46:15 +00:00
Weny Xu 36423a95c6 fix(operator): reuse catalog table resolution for write retries (#9574)
* fix(operator): inherit logical table partitions when retrying writes

Signed-off-by: WenyXu <wenymedia@gmail.com>

* fix(operator): resolve retried writes through catalog manager

Signed-off-by: WenyXu <wenymedia@gmail.com>

---------

Signed-off-by: WenyXu <wenymedia@gmail.com>
2026-10-14 08:42:51 +00:00
dennis zhuang 5c4d9eb4f8 fix: align fulltext bloom tokens with matches_term and use them for LIKE (#9470)
* fix: align fulltext bloom tokens with matches_term and use them for LIKE

The bloom fulltext index stored tokens that did not follow
matches_term's word boundaries (`_`, ASCII next to Han, Han substrings),
so pruning dropped rows matches_term accepts.

Tokens and query probes now share the character classes of
matches_term, Han runs are indexed as bigrams, and LIKE patterns use the
same probes. The bloom blob is written under a new key; blobs from older
versions are no longer probed. Tantivy no longer serves matches_term.

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* chore: drop unused lazy_static from index and avoid typo-flagged test tokens

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* docs: link like_probes to tokenize instead of the downstream ScriptTokenizer

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* refactor: name probe extraction with verbs and document CharClass

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* feat: rebuild legacy fulltext bloom indexes and probe lower(col)

The manifest records the fulltext bloom version per column, so ADMIN
BUILD_INDEX now rebuilds SSTs whose bloom index predates the current
tokens, and ssts_index_meta shows the version.

Case-insensitive bloom indexes also store the tokens of the whole
lowercased text for rows where it can differ (U+0130, U+212A, sigma),
so matches_term(lower(col), ..) and lower(col) LIKE .. use the index.

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* test: cover legacy bloom index rewrite by compaction in the compat case

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* chore: log outdated fulltext bloom indexes in the consistency check

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* docs: explain the unrecorded fulltext bloom version

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

---------

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-14 08:07:24 +00:00
fengyue-xve 09bbe1cf9f refactor(promql): centralize PromQL function registration in promql::functions (#9500)
* refactor(promql): centralize PromQL function registration in promql::functions

Move the PromQL scalar UDF and UDAF registrations out of the query plan
decoder into a single `promql::functions::register_promql_functions`
entry point, so plan decoding no longer has to enumerate every PromQL
function implementation. The registered function set, aliases (e.g.
`prom_holt_winters`) and registration order are unchanged.

Add a registration test pinning the full set of `prom_*` scalar
functions and the `prom_holt_winters` alias, plus a decode regression
test covering the centralized registration path.

Fixes #9493

Signed-off-by: fengyue-xve <1759519137@qq.com>

* refactor(promql): register Ieee UDFs centrally and address review

Rebase onto main picked up #9479, which registered the Ieee comparison
and sqrt UDFs from the decoder directly. Register them from
`register_promql_functions` instead so the single entry point stays
complete, and add the seven `prom_eq`..`prom_sqrt` names to the
registration test.

Also per review: drop the doc paragraph that explains why the function
was moved, drop the redundant `test_serializer_decode_centralized_promql_registration`
test and the registration comment in the decoder, move `use std::sync::Arc`
up with the imports, and simplify the registration test assertions.

Signed-off-by: 风月 <1759519137@qq.com>
Signed-off-by: fengyue-xve <1759519137@qq.com>

---------

Signed-off-by: fengyue-xve <1759519137@qq.com>
Signed-off-by: 风月 <1759519137@qq.com>
2026-10-14 07:33:52 +00:00
Yingwen 00aa65de7a fix(query): guard deep expressions during query planning (#9564)
* fix(query): avoid speculative clones in constant normalization

Signed-off-by: evenyag <realevenyag@gmail.com>

* fix(query): reject deeply nested expressions before optimization

Signed-off-by: evenyag <realevenyag@gmail.com>

---------

Signed-off-by: evenyag <realevenyag@gmail.com>
2026-10-14 06:49:35 +00:00
sun 4ff3296f97 feat: update dashboard to v0.14.2 (#9570) 2026-10-14 06:14:58 +00:00
jeremyhi a08e5bcceb fix(log-store): keep the enqueued backlog on permanent object store errors (#9558)
* fix(log-store): keep the enqueued backlog on permanent object store errors

On object storage the WAL's object store sits behind OpenDAL's retry
layer, which marks every error it returns as persistent. The enqueued
mode classified create failures by that status, so a 403 or a missing
bucket was repeated every 100 ms on every create in flight, logged
nothing, and made appends hang once the sealed batches were full.

Object store errors are now classified by kind: denied access, an
invalid configuration (how OpenDAL reports a missing S3 bucket) and a
write to a missing location are non-retriable. In the enqueued mode such
an error makes the store failing instead of poisoning it: the
acknowledged backlog is kept under its sequences and bytes, its lowest
pending batch is attempted alone with a delay that doubles from 100 ms
to 30 s, appends are rejected at once with a retryable error that
carries the last object store error, and the first create that succeeds
ends the state. Stop uploads the backlog at once and reports a failure
as before. The state is logged on entry, at most once a minute while it
lasts and on exit, and exported as the `failing` gauge and the
`rejected_appends_total` counter. Conflicts, encoding and catalog errors
still poison the store; the durable mode is unchanged.

An append held back because the sealed batches are full is now counted
and timed by the stall metrics in both modes.

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* docs(rfc): describe how the enqueued object store WAL handles refused creates

Describe the enqueued failure contract as the store now implements it:
non-retriable object store errors are told apart by kind because
OpenDAL's retry layer under the store marks every error persistent, a
failing store keeps its backlog and attempts it with backoff while it
rejects appends, and stop uploads the backlog at once. Add the failure
matrix row, the failing gauge and the rejected appends counter, the
sealed-batch admission limit and the stall metrics that now count it,
and the fault matrix case counts.

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* fix(log-store): time the failing attempts where they start and fix two statements

The test of the attempts of a failing store now records when each
refused write starts and checks the gaps between them, instead of
sampling a counter after a sleep of the test task. The delay comment and
the RFC describe 30 seconds as the longest delay between two attempts,
not as a bound on when appends resume, and the RFC states that the next
append is held once seven sealed batches wait.

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* test(log-store): drop the wait_until helper that main now defines

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* refactor(log-store): name errors that need an operator and trim the RFC contract

Rename is_non_retriable to requires_intervention: such a create is still
repeated, only slowly, until someone fixes the credentials, configuration
or bucket. Name the backoff test after what it asserts, cut the test of
the lowest pending batch to two failed rounds since the cadence is
covered by the backoff test, and shorten the RFC failure contract to
the contract and its rationale, leaving error mappings, request counts
and logging cadence to the code comments.

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* docs(log-store): tie the slow repeat to errors requiring intervention

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

---------

Signed-off-by: jeremyhi <fengjiachun@gmail.com>
2026-10-14 06:10:26 +00:00
discord9 0e40281262 fix(promql): stop claiming scalar calculate preserves order (#9523)
* test: cover scalar calculate order contract

Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>

* fix(promql): stop claiming scalar calculate preserves order

Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>

* docs(test): describe scalar ordering regression as pre-fix behavior

Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>

---------

Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-14 04:20:39 +00:00
Ning Sun f41e86f43a feat(meta-client): forward actor and event context for region follower RPCs (#9568)
The manage-region-follower chain submitted its procedures with an empty
executor context: `ProcedureServiceHandler::manage_region_follower`
accepted no query context, the operator built an
`ExecutorContext::default()`, and `MetaClient` dropped the context before
delegating to `RegionFollowerClient`. The submitting user (actor) and the
procedure event metadata therefore never reached the submitted
procedures.

- `ProcedureServiceHandler::manage_region_follower` now takes a
  `QueryContextRef`, consistent with `migrate_region`, `gc_regions` and
  `gc_table`.
- `ProcedureServiceOperator` derives the `ExecutorContext` (actor and
  `TriggerReason::Manual` event input) from the query context.
- The `RegionFollowerClient` trait methods now accept `&ExecutorContext`
  and `MetaClient` forwards it, so client implementations can transport
  the actor and event context on the wire.
- `procedure_event_context`/`procedure_actor` are now public so client
  implementations can reuse the trusted protocol derivation.
2026-10-14 04:11:53 +00:00
discord9 75bc4ce46d fix(table): stop claiming tag order for logical metric scans (#9522)
* test: cover metric logical scan tag ordering

Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>

* fix(table): only claim projected primary key prefix ordering

Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>

* fix(table): keep physical key ordering for metric projections

Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>

* test(table): compare unknown partition counts explicitly

Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>

* test(table): model scoped internal TSID scan properties

Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>

---------

Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-14 03:35:58 +00:00
Weny Xu f690bbb204 refactor!: remove datanode remote WAL index (#9563)
* refactor: remove datanode remote WAL index

Signed-off-by: WenyXu <wenymedia@gmail.com>

* fix(log-store): update new WAL replay tests after index removal

Signed-off-by: WenyXu <wenymedia@gmail.com>

---------

Signed-off-by: WenyXu <wenymedia@gmail.com>
2026-10-13 15:31:04 +00:00
Weny Xu 863eebdecb feat(frontend): retry transient distributed write failures (#9543)
* refactor(operator): route shared requests through NodeManager

Remove the concrete NodeClients requester API and use the existing node manager for owned and shared requests. Preserve the original write hint while the legacy error adapter remains in place.

Signed-off-by: WenyXu <wenymedia@gmail.com>

* fix(meta): preserve retry policy through error hints

Propagate client errors through External and let DDL read retry hints while preserving cleanup and terminal-child policies. Region transport failures retain the legacy Retryable classification, which now also participates in bounded write retries.

Signed-off-by: WenyXu <wenymedia@gmail.com>

* fix(operator): restore sparse partition tags when rebuilding writes

Decode retained primary keys when refreshed partition expressions need different tags. Keep the partitioner and multi-region sparse write regression tests with the fix.

Signed-off-by: WenyXu <wenymedia@gmail.com>

* fix(operator): stop detached write retries when callers cancel

Signed-off-by: WenyXu <wenymedia@gmail.com>

* feat(frontend): configure retries across distributed write paths

Wire the shared dispatcher through frontend and logical batching, preserving partition columns and request headers. Keep standalone retries disabled and include configuration, batching, and storage regression coverage.

Signed-off-by: WenyXu <wenymedia@gmail.com>

---------

Signed-off-by: WenyXu <wenymedia@gmail.com>
2026-10-13 14:51:35 +00:00
Lei, HUANG 4bd36cfd20 feat: support compaction options in HTTP hints (#9560)
* feat: support compaction options in HTTP hints

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>

* refactor: share TWCS compaction option prefix

Use the store-api constant for both HTTP hint inference and Mito region option validation so the two paths cannot drift.

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>

---------

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
2026-10-13 12:28:36 +00:00
jeremyhi 55d753ca58 perf(log-store): fetch object store WAL replay segments concurrently (#9555)
* perf(log-store): fetch object store WAL replay segments concurrently

A region read fetched each segment only after the previous object's
entries were yielded, so a replay paid the full request latency once per
object. Fetch up to READ_PREFETCH_DEPTH (8) segments ahead, each on its
own task, and handle their outcomes in object sequence order: entries,
collected-object skips, corrupted-segment holes and errors surface
exactly as before, and dropping the stream aborts the fetches in flight.
A read holds at most eight decoded segments besides the one it yields.

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* perf(log-store): raise object store WAL recovery concurrency to 64

On S3, recovery reads the header and tail of every object, about 57 to
91 ms per object per lane on 4, 8 and 16 vCPUs alike, and its time
scales with objects divided by concurrency up to 128 lanes without
throttling: about 9,500 objects recovered in 99 s at 8 and 10.5 s at
64. At 64 recovery issues about 1,800 reads per second, a third of
S3's request rate per prefix, and holds one 64 KiB tail window per
lane, 4 MiB in all.

The recovery concurrency tests now scale with the constant.

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* perf(log-store): share one prefetch byte budget among object store WAL reads

Each read fetched up to eight segments ahead on its own, so regions
opened in parallel (16 by default) could together hold 128 segments of
up to max_batch_bytes each. A read now always fetches the segment it
yields next, as before, and fetches a later one only while its length
fits in a 64 MiB budget shared by every read of the store. Regions
replayed in parallel thus hold one segment each plus at most 64 MiB,
however many open at once. Nothing waits on the budget: a read that
cannot reserve stops fetching ahead until its next poll.

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* fix(log-store): fail an object store WAL read whose fetch task panics

A fetch task that panicked was re-raised in the reader with
resume_unwind, which unwinds through the caller, such as Mito's region
opener task, past its cleanup. Return it as a WalSegmentFetch error
instead, so the read ends at that object like any other failed fetch.

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* fix(log-store): bound replay prefetch by decoded size held by fetch tasks

The prefetch reservation sat in the read's queue, so dropping a read
released it at once while an aborted fetch could still hold its
buffers until it next yielded. The fetch task now holds the reservation
and returns it with its outcome, so it is released with the buffers.

A reservation also counted only the encoded segment length, while a
fetched segment is held decoded. It now counts the length plus one
Record per entry, and the comment states the whole bound.

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* docs(log-store): round the measured figures in the recovery concurrency comment

Keep the magnitudes in the comment; the exact S3 figures belong to the
measurement run rather than the code.

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* refactor(log-store): abort replay fetch tasks with tokio-util's AbortOnDropHandle

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* refactor(log-store): rename the replay prefetch reservation to try_reserve_prefetch_bytes

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

* test(log-store): share the bounded polling helper across the object store WAL tests

Signed-off-by: jeremyhi <fengjiachun@gmail.com>

---------

Signed-off-by: jeremyhi <fengjiachun@gmail.com>
2026-10-13 12:26:16 +00:00
dennis zhuang 2a70194930 feat: add per-column COMPRESSION option for SST columns (#9426)
* feat: add per-column COMPRESSION option for SST columns

CREATE TABLE accepts COMPRESSION WITH (type = 'zstd', level = N,
page_size = '<size>') on a column. The options are stored in the column
metadata, carried through gRPC column options, shown by SHOW CREATE
TABLE, and applied by the mito SST writer and bulk part encoder as
parquet column properties. Unset fields keep the SST defaults. Nested
types are rejected.

A page size below the dictionary page limit also lowers the column's
dictionary page limit: parquet sizes write batches by the dictionary
budget and keeps that size after falling back to plain encoding, which
would otherwise ignore the smaller data page limit.

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* fix: validate column compression options before persistence

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* fix: reject compression overrides on metric logical tables

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

---------

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-13 08:03:49 +00:00