Skip to content

docs: correct outdated Nightly contributor guide content - #2784

Open
killme2008 wants to merge 9 commits into
mainfrom
codex/audit-contributor-guide-links
Open

docs: correct outdated Nightly contributor guide content#2784
killme2008 wants to merge 9 commits into
mainfrom
codex/audit-contributor-guide-links

Conversation

@killme2008

@killme2008 killme2008 commented Aug 25, 2026

Copy link
Copy Markdown
Member

What changed

Correct and complete the Nightly contributor guide while keeping it focused on component contracts, main execution paths, and contributor decisions rather than source navigation.

  • Replace the early Metasrv design draft and speculative proto examples with current metadata, procedure, leader-election, heartbeat, failover, control-path, and table-route concepts.
  • Explain both Flownode execution paths: batching is the primary path for aggregation and TQL workloads; streaming is retained for compatibility and deprecated for new workloads.
  • Clarify Frontend request paths, Datanode Region dispatch, Mito WAL recovery boundaries, query planning and execution, partition routing and conservative pruning, and the conditional creation of Puffin index files.
  • Turn the testing pages into a test-selection guide covering package tests, Sqlness, integration tests, compatibility tests, and result review.
  • Document the current gRPC ingester contract: generated stubs, request representations, success and error metadata, bounded retries, and ambiguous delivery for unary and streaming writes.
  • Add the missing Metasrv node-lease, recovery, and table-ID sequence endpoints, including their operational constraints.
  • Use the official Apache Parquet file-layout diagram and identify its source.
  • Keep the default selector recommendation, intentional overview links, and DeepWiki as a labeled secondary reference.
  • Remove the obsolete Python Scripts pages after the implementation was removed.
  • Tighten a small number of inflated or awkward sentences without expanding their technical scope.

The architecture and testing boundary follows established contributor documentation practice: explain abstractions, flows, invariants, and how to validate a change; leave implementation-level exploration to the source. No source directory or file-path navigation is added to the architecture pages.

Scope

  • Documentation versions: Nightly only; released versions are deferred for version-by-version review.
  • Languages: English, Chinese

Verification

  • DOC_LANG=en pnpm check:links
  • DOC_LANG=zh pnpm check:links
  • typos on all modified Markdown files
  • git diff --check
  • Verified version-sensitive claims against GreptimeDB main at 0cc83c4570 and the current greptime-proto definitions.
  • Reviewed the complete diff relative to main; no released/0.x docs, user-guide pages, generated outputs, configuration, or lockfiles changed.

Checklist

  • I verified the content against the applicable GreptimeDB version.
  • I updated the relevant documentation versions and languages, or explained why not.
  • I checked changed links and anchors.
  • I updated navigation when the document structure changed. No navigation update is needed because the removed pages were already excluded from the build.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 25, 2026

Copy link
Copy Markdown

Deploying greptime-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5300142
Status: ✅  Deploy successful!
Preview URL: https://5fd3fc7d.greptime-docs.pages.dev
Branch Preview URL: https://codex-audit-contributor-guid.greptime-docs.pages.dev

View logs

@killme2008 killme2008 changed the title docs: refresh Nightly contributor guide docs: correct outdated Nightly contributor guide content Aug 25, 2026

## Batching mode

Batching mode reuses GreptimeDB's query engine instead of maintaining an operator graph for every incoming row. For a time-windowed Flow, its main loop is:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please take a look at this document that describes the dataflow of Flow engine. @discord9

- /health
- /leader
- /heartbeat
- /node-lease

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please take a loot at this document @WenyXu

- Load balancing for Datanode, determines who should handle new table creation requests, more precisely, it makes resource allocation decisions.
- Election & High Availability, GreptimeDB is designed in a Leader-Follower architecture, only Leader nodes can write while Follower nodes can read, the number of Follower nodes is usually >= 1, and Follower nodes need to be able to switch to Leader quickly when Leader is not available.
- Statistical data collection (reported via Heartbeats on each node), such as CPU, Load, number of Tables on the node, average/peak data read/write size, etc., can be used as the basis for distributed scheduling.
Metasrv is the metadata and coordination service in a distributed GreptimeDB cluster. It does not sit on the data path. Its main responsibilities are:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please take a look at this document @WenyXu

@killme2008
killme2008 marked this pull request as ready for review August 28, 2026 06:29
table_B
...

A table route maps each Region to its current Datanode peer. It does not contain a separate list of read replicas:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Table routes can carry read followers. At 0cc83c4570, RegionRoute has both leader_peer and follower_peers, and TableRoute::try_from_raw populates the latter from follower_peer_indexes. The current statement and one-peer diagram are therefore inaccurate even when a deployment has no followers configured. Could we describe one write leader plus zero or more follower/read peers, and update the Chinese page as well?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 1be0a8f. The English and Chinese overviews now describe one leader plus zero or more followers, including the read-replica case, and the route diagram matches that model.

Comment thread docs/contributor-guide/metasrv/admin-api.md Outdated
- 存储 Catalog、Schema、Table、Region、路由和节点元数据;
- 为新 Region 选择 Datanode,并维护表路由;
- 选举一个 Metasrv leader 负责协调元数据变更;
- 通过可恢复的 Procedure 执行 DDL、Region 迁移、故障转移和 repartition;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The glossary uses Repartition (重分区), while this Chinese sentence leaves lowercase repartition in otherwise Chinese prose. Could we use 重分区 or the established Repartition spelling to keep the terminology consistent?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 1be0a8f. The Chinese overview now uses “重分区”.

@killme2008
killme2008 force-pushed the codex/audit-contributor-guide-links branch from ca9f14d to 1be0a8f Compare August 28, 2026 07:17
description: How Mito organizes mutable Region data in memtables and moves it into SST files.
---

# Memtable design

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This a new document about memtable, please take a look @evenyag

Batching mode reuses GreptimeDB's query engine instead of maintaining an operator graph for every incoming row. For a time-windowed Flow, its main loop is:

1. A source-table write marks the affected time windows as dirty.
2. A `BatchingTask` wakes on its schedule or after a notification and collects pending dirty windows.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BatchingTask is not awakened by dirty-window notifications in the current implementation. The dirty handlers only update dirty_time_windows; scheduled tasks wait until the next scheduled evaluation, while adaptive tasks check pending work after their polling sleep. Could we replace “wakes on its schedule or after a notification” with something like “runs on its evaluation schedule or adaptive polling cadence and consumes pending dirty windows on its next evaluation”? The same notification-wakeup wording in batching_mode.md should be adjusted as well.

@WenyXu WenyXu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These comments clarify two Metasrv contracts that contributors must preserve: cache-invalidation fan-out and the separation between lease renewal and Region failure detection.

- electing one Metasrv leader to coordinate metadata changes;
- running recoverable procedures for DDL, Region migration, failover, and repartitioning;
- tracking node leases and Region statistics through heartbeats;
- notifying Frontends and Datanodes when cached metadata or Region state changes.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MetasrvCacheInvalidator broadcasts each InvalidateCaches instruction to the Frontend, Datanode, and Flownode mailbox channels. This bullet and the diagram omit Flownode and couple cache invalidation to Region-state notifications. Could we state that cache invalidations go to all three channels, while Region lifecycle instructions target Datanodes, and update the Chinese page as well?

Datanodes maintain heartbeat streams to the Metasrv leader. Heartbeat requests report node identity, lease information, Region statistics, and other state used for placement and supervision. Responses carry control messages such as Region lifecycle instructions and cache invalidations.

However, GreptimeDB still faces a more complex situation than DynamoDB, in particular, RCU doesn't fit to describe GreptimeDB's read workloads which require a lot of computation. We are working on that.
Metasrv treats a heartbeat as a lease renewal, not merely as a metrics sample. Lease expiration is therefore part of failure detection and can lead to a Region failover procedure. Changes to heartbeat timing must remain consistent with the lease and supervision intervals.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The failover path is not driven by lease expiration. DatanodeKeepLeaseHandler renews a Datanode lease, while RegionSupervisor applies per-Region Phi Accrual detectors to heartbeat-arrival intervals and submits failover migrations only when Region failover is enabled. Could we separate these contracts here and link to the Region Failover guide for its enablement and storage prerequisites? The Chinese text has the same causal claim.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants