getClusterChunksStatus

Syntax

getClusterChunksStatus()

Details

This function obtains the metadata about all database chunks (file chunks and tablet chunks) on the data nodes in a cluster. It can be executed only on a controller. It returns a table containing the following columns:

  • chunkId: the chunk ID.

  • file: the chunk path.

  • size: The disk space occupied by the file chunk (in Bytes). Return 0 for a tablet chunk. Use getTabletsMeta to check the disk usage of a tablet chunk.

  • version: the version number of the current chunk.

  • vcLength: length of the version chain.

  • versionChain: version chain of the chunk, e.g. "18441:76:1:346 -> 18441:0:0:346 -> ", where

    18441 76 1 346
    cid (chunk ID) chunk size version number sid (snapshot ID)
  • state: the chunk state. It can be

    • CONSTRUCTING: in transaction;

    • RECOVERING: recovering;

    • COMPLETE: transaction completed.

  • replicas: the replica information of the chunk, e.g., "local8848:1:0:false:1671075776643574000", where

    local8848 1 0 false 1671075776643574000
    node alias where the replica is located version number whether the replica is corrupted whether a transaction is in resolution the latest report timestamp on the node
  • replicaCount: the number of replica(s).

  • lastUpdated: the timestamp for last update. Note that lastUpdated column is supported since version 1.30.20/2.00.1. For a chunk created before, it returns a NULL value.

  • permission: the chunk permission. It can be READ_WRITE (default), READ_ONLY, WRITE_ONLY, and UNKNOWN. Chunks that are being transferred or stored in S3 are READ_ONLY.

For READ_ONLY chunks:

  • Data cannot be appended or updated. Only drop operations can be performed to delete records. Transaction is supported in the READ_ONLY chunks (except for those stored in S3).
  • Operations such as recovery and rebalance cannot be performed.

Examples

rpc(getControllerAlias(), getClusterChunksStatus);
chunkId file size version vcLength versionChain state replicas replicaCount lastUpdated permission
092d5e12-e595-6f… /testDB/pt2.tbl 49 1 1 2052:49:1 -> COMPLETE P1-node1:1:0,P2-… 2 2022.03.31T18:09:41.138 READ_WRITE
42936e31-8be0-fa… /testDB/9/i 0 2 2 2053:0:2 -> 2051… COMPLETE P3-node1:2:0,P1-… 2 2022.03.31T18:09:41.138 READ_WRITE
d31e6b47-18f0-37… /testDB/7/i 0 2 2 2053:0:2 -> 2051… COMPLETE P1-node1:2:0,P2-… 2 2022.03.31T18:09:41.138 READ_WRITE
647a5fd6-cd85-3b… /testDB/6/i 0 2 2 2053:0:2 -> 2051… COMPLETE P1-node1:2:0,P3-… 2 2022.03.31T18:09:41.138 READ_WRITE
8bec6445-bc6d-36… /testDB/5/i 0 2 2 2053:0:2 -> 2051… COMPLETE P2-node1:2:0,P3-… 2 2022.03.31T18:09:41.138 READ_WRITE
ca690ba5-be73-a6… /testDB/4/i 0 2 2 2053:0:2 -> 2051… COMPLETE P3-node1:2:0,P1-… 2 2022.03.31T18:09:41.138 READ_WRITE