mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-11-26 12:44:10 +00:00
2effff48d5fbea48ddae79c28b36aec2a31094de
8
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
c8e0d29df2 |
feat(mito2): publish table compaction results conditionally (#10310)
* feat(mito2): publish table compaction results conditionally Publish one region from a live input snapshot using an ordinary file-only edit. Permit repeated submissions and partial success without manifest task state, while preserving sequence, GC protection and uncertain-write recovery. Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * refactor(mito2): write table compaction outputs to level 0 Route split outputs into the ordinary L0 pipeline so window merges and semantic folding stay with region compaction. Update publication validation and tests accordingly. Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * fix(mito2): release verified footers before manifest publication Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * refactor(mito2): compare typed table compaction options Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * test(mito2): cover table compaction output validation failures Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * docs(mito2): clarify series count verification limits Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * fix(mito2): reject index declarations without output index objects Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * docs(mito2): document table compaction outputs as L0 Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * docs(mito2): map the table compaction publication module Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> --------- Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> |
||
|
|
e2e980fe39 |
feat(mito2): add column sketch options and index metadata (#10295)
Signed-off-by: WenyXu <wenymedia@gmail.com> |
||
|
|
47bf7de138 |
feat(mito2): add lossless multi-region compaction workers (#10104)
* feat(mito2): add lossless multi-region compaction executor Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * refactor(mito2): use bounded workers for multi-region compaction Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * fix(mito2): materialize compaction routing fragments on demand Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * fix(index): clean up Tantivy resources on cancellation Keep temporary directories alive through initialization and in-flight writer finalization. Release writers and remove directories on the shared blocking runtime, and retain the finishing task so abort can join it safely. Cover creator lifecycle cleanup and multi-region cancellation and sibling failure after Tantivy initialization. Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * refactor(mito2): stream single-window multi-region compaction Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * test(mito2): read published multi-region outputs with real metadata Multi-region output metadata was only inspected field by field; every successful read cleared the sequence bound and forced the preserve marker, so partition filtering and sequence override were never exercised with the metadata a caller publishes. Read each output again with the returned FileMeta and the target metadata, and require the same row count and the same reader-visible sequences. Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * test(mito2): cover multi-region routing mask rejection The exclusive-routing guards were unreachable: every fixture used a partition rule whose masks happened to be disjoint and correctly sized. An unchecked caller-supplied rule can still violate both invariants, and a violation would route one physical row to several target regions. Cover both guards: overlapping predicates from a real rule with check_exprs=false, and an over-short mask from a minimal rule implementation. Both must fail before any output is protected. Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * test(mito2): cover JSON2 rewrite through multi-region compaction The multi-region executor wires the shared JSON2 rewrite plan by column id and target layout, but no fixture carried a JSON2 column, so neither the per-target mapping nor the materialized values were exercised. Write a source SST with a narrower JSON2 layout (one key stays in the remainder), compact it into a wider target layout, and read the output back: require the target physical layout and the original key values. Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * test(mito2): cover every validate_plan rejection Plan validation is the boundary that keeps malformed inputs away from the routing and writer stages, but only the happy path was exercised. Mutate a valid plan for each rejection (budgets, control state, empty targets, window alignment/overflow, source ownership, duplicates, missing inputs, mismatched schemas) and require the specific reason under a timeout, with no protected outputs. Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * test(mito2): assert multi-region output bytes and retained groups output_bytes had no positive assertion, and the peak check was an upper bound that also holds when the peak is never recorded. Require the reported bytes to equal the sum of the produced files and the peak equal-key group storage to be non-zero. Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * test(index): cover retained Tantivy finalization on abort and drop Cancellation was only exercised after finish_writer returned, so the retained finalization handle and the directory lease it holds were never tested. Simulate a commit that is still running, then require abort to join it before removing the directory and creator drop to clean up after the lease is released. Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * refactor(mito2): share sequence provenance helpers on FileMeta The multi-region writer duplicated the trust predicate and maximum-bound fold that read paths and DefaultSstMerger already rely on, so the two could disagree about whether a file's row sequences are trustworthy. Move both rules onto FileMeta, delegate from FileHandle, and reuse them from the multi-region writer and the compactor. Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * docs(mito2): document the guarded SST write path write_sst_with_guard is the enterprise seam whose behaviour is not visible from its signature, and the comment above the non-cache arm still claimed the cache was unconditionally disabled. Describe the bypass, the single upload stream and the pre-create guard, and correct the stale comment. Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * docs(mito2): document multi-region plan budget fields The public plan left max_output_file_size and window_seconds without units or semantics, and memory_limit without the multipart-minimum floor implied by admission. State all three so callers cannot budget against the wrong unit. Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * docs(mito2): explain the multi-region row-group cap Capping output row groups at 1024 rows diverged from ordinary compaction without saying why. Record that the cap bounds the encoder working set that each resident target admits, and keep the behaviour unchanged. Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * style(mito2): separate new error variants consistently Every other variant in the enum is separated by a blank line; the new enterprise variants were glued to their neighbours. Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * docs(mito2): quote the new module identifier in the module map Every other row of the module map starts with a backticked identifier; the multi-region row did not. Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * test(mito2): prefix multi-region tests with test_ Every other test under compaction/ is named test_*, so name-filtered runs and IDE grouping silently skipped this module. Rename only the test functions; assertions are unchanged. Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * style(mito2): wrap the multi-region scan stream bodies rustfmt does not reflow async_stream macro bodies, so the shared scan kept statements far past the column limit. Split them into one statement per line; behaviour is unchanged. Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * test(mito2): make the table-stage folding cases independent Both parametrized cases used identical options and differed only by merge_mode, which the table stage never reads, so the second case re-ran the first. Keep the ignored-merge-mode case and spend the second on preserve_row_sequence, asserting the per-file marker as well as the row count. Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * test(mito2): fix partition mask test name Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * style(mito2): wrap multi-region worker macro bodies Wrap receive and accounting expressions and expand the scan completion arm without changing worker behavior. Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * docs(mito2): document multi-region output levels Document that returned files default to L1 and callers must adjust metadata before publication when another level is intended. Distinguish this convention from changing existing persisted levels. Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * fix(mito2): identify invalid multi-region plan fields Report each invalid source or execution limit separately while preserving validation order and thresholds. Update rejection cases and cover negative window widths. Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * test(mito2): consolidate multi-region compaction regressions Share SST fixtures and complete-row oracles while preserving non-append, JSON2, sequence, and cancellation coverage. Drive Tantivy finalization tests through the real finish path. Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> --------- Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> |
||
|
|
bd77b599cc |
refactor(flow): remove tracked-write protocol (#9992)
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com> |
||
|
|
c3469fad51 |
fix(flow): retain tracked write completion across transient failures (#9525)
* fix(flow): retain tracked write completion across transient failures Use receiver-issued single-write capabilities at the frontend and datanode. Rejoin exact admitted writes across unknown transport outcomes, then close and drain before allowing subsequent rounds. Keep ordinary clients and reads on their existing paths. Separate schema map equality from encoded row identity so fresh protobuf decodes replay consistently even with NaN values. Cover receiver admission, owner cancellation, all-child drain, and retired capabilities. Local feature-worktree checkpoint only. Main verified core enterprise check and 484 tests, plus DN enterprise check and all four tracked owner tests. Corrected seven-case timer acceptance remains to be rerun; this checkpoint does not authorize publishing or integration. Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com> * fix(flow): preserve upstream dependencies after rebase Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com> * fix(flow): fail fast on definitive tracked-write open rejection A tracked write treats every application-level error from the frontend as an ambiguous transport failure and retries the same pinned frontend forever. During a rolling upgrade an older frontend does not recognize the tracked-write command extension and processes Open as an ordinary empty SQL query, rejecting it with InvalidSql (InvalidArguments); a non-internal endpoint rejects the extension outright. Both are definitive rejections that no same-frontend retry can ever resolve, so the flow stalls. Classify the Open-phase errors by status code: a definitive rejection (Unsupported / InvalidArguments / PermissionDenied) fails fast with a terminal pre-write error, while genuinely ambiguous transport failures (Unavailable, timeout, connection reset, ...) keep the same-capability retry. Write/Close rejections are deliberately NOT failed fast: once a write may have been admitted, a same-code rejection (e.g. WriterLost, or UnknownCapability after a VIP moved Open->A/Write->B) leaves the outcome ambiguous, and failing fast would let the caller replay and duplicate rows. Add a regression test that a legacy empty-SQL Open rejection fails fast with a single attempt and surfaces as Error::External carrying a TerminalError. Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com> * fix(flow): preflight tracked writes without submitting data Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com> * test(flow): retain tracked command extensions while decoding Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com> --------- Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com> |
||
|
|
c55f297dec |
chore!: gate soft-drop table behind the enterprise feature (#8747)
* chore: gate soft-drop table behind the enterprise feature Soft-drop table becomes an enterprise-only feature: - metasrv rejects gc.experimental_soft_drop.enable=true at startup in non-enterprise builds, and ddl_soft_drop_enabled is hard-disabled without the enterprise feature as a second line of defense - the UNDROP TABLE parser/AST/statement variant, ADMIN purge_table() registration, and information_schema.recycle_bin registration are compiled out unless the enterprise feature is enabled - common-meta procedures, tombstone keys, and DdlTask serde stay unconditional for persisted-procedure recovery and wire compatibility - the [gc.experimental_soft_drop] section is removed from the OSS example config and generated docs (moving to the enterprise repo) - the soft-drop sqlness cases and their CI job are removed from OSS (moving to the enterprise repo); affected information_schema .result files are regenerated Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * refactor: limit unused_variables allow to non-enterprise builds Addresses review comment: apply the allow via cfg_attr so enterprise builds still catch accidental unused variables in register_admin_only. Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * refactor: include the config key in the soft-drop enterprise gate error Addresses review comment: name gc.experimental_soft_drop.enable in the startup validation error so users can locate the setting quickly when it is set via env vars or layered config. Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * test: limit unused_mut allow to non-enterprise builds Addresses review comment: apply the allow via cfg_attr so enterprise builds still catch unused mut in the table_ddl_event test setup. Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * feat: reject soft-drop DDL submissions in non-enterprise builds Addresses review comment: clients could bypass the SQL-level gates by submitting DdlTask::UndropTable or DdlTask::PurgeDroppedTable directly to the procedure service. Reject fresh submissions at the DdlManager boundary in non-enterprise builds while keeping the procedure loaders registered for crash recovery and wire compatibility. Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * test: stop --enable-gc from enabling soft drop in the sqlness template Addresses review comment: the metasrv test template rendered [gc.experimental_soft_drop] enable = true under the generic --enable-gc flag, which non-enterprise metasrv now rejects at startup, making the documented --enable-gc mode unusable in OSS. Keep the flag scoped to plain GC; enterprise soft-drop coverage moves to the enterprise repo. Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * fix: gate fresh soft-drop procedures Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * test: gate soft-drop fallback coverage Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * fix: gate soft-drop procedure implementation Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * refactor: gate drop table soft-drop behavior Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * refactor: gate expired soft-drop gc behavior Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * ci: test enterprise table ddl lifecycle Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * chore: mark purge_table as enterprise licensed The purge_table module is compiled only with the enterprise feature, so apply the Enterprise License header and register it with both license header configurations. Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * chore: mark recycle_bin as enterprise licensed The recycle_bin module is compiled only with the enterprise feature, so apply the Enterprise License header and register it with both license header configurations. Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * chore: mark soft-drop procedure sources as enterprise licensed The purge and undrop procedure implementations plus the recycle-bin test module compile only with the enterprise feature. Apply the Enterprise License header and register them with both license configurations. Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> --------- Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> |
||
|
|
7a4812c522 |
chore: check enterprise-gated files are listed in both license configs (#8750)
* chore: check enterprise-gated files are listed in both license configs A file reachable only through `#[cfg(feature = "enterprise")] mod ...;` is governed by the GreptimeDB Enterprise License, so it must appear in the `includes` of licenserc-enterprise.toml and the `excludes` of licenserc.toml. hawkeye stays silent when it does not: the file keeps its Apache-2.0 header and passes the default check precisely because it was never excluded from it. scripts/check-enterprise-license.py walks enterprise-gated `mod` declarations, resolves them to files (submodules included) and diffs that set against both configs, also reporting stale entries. It runs in the license job in CI and as `make check-enterprise-license`. Documents the split it cannot decide for you — whole enterprise features get their own file, a gated match arm stays inline — in .agents/architecture-invariants.md. Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * fix: tighten enterprise license checks Signed-off-by: Dennis Zhuang <killme2008@gmail.com> --------- Signed-off-by: Dennis Zhuang <killme2008@gmail.com> |
||
|
|
e89d591cb4 |
chore: declare GreptimeDB Enterprise License for enterprise-gated sources (#8364)
* chore: declare GreptimeDB Enterprise License for enterprise-gated sources The `enterprise`-feature-gated sources (triggers, mito2 extension) were excluded from the Apache-2.0 header check but carried no license of their own. Declare a separate GreptimeDB Enterprise License and enforce it. - Add LICENSE-ENTERPRISE (open-core split; core stays Apache-2.0). - Add an Enterprise License header to each enterprise source file. - Add licenserc-enterprise.toml and a second hawkeye step in CI to enforce the Enterprise header on exactly those files. - Cross-reference the two complementary file lists; document the layout in licenses/README.md and the README License section. Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * chore: reference per-customer Enterprise Agreement instead of a terms URL There is no public enterprise-terms page; each customer signs an individually negotiated agreement. Point the license at a "separate written commercial agreement with GrepTime Inc." and direct readers to the existing contact page. Signed-off-by: Dennis Zhuang <killme2008@gmail.com> --------- Signed-off-by: Dennis Zhuang <killme2008@gmail.com> |