Get desktop application:
View/edit binary Protocol Buffers messages
TODO: rename to FlushOrCompact TablesRequestPB https://github.com/YugaByte/yugabyte-db/issues/729
Whether we want to compact the tablets instead of flushing them.
Whether we want to include index tables in this flush. If there are index tables in the tables field this field must be set to false, otherwise the request will fail.
Whether the operation only applies to regular RocksDB but not intents RocksDB.
true if the flush tables operation is completed, false otherwise.
true if the flush tables operation is successful.
(message has no fields)
(message has no fields)
Time when an admin compaction was last requested by the user.a Raw representation of a HybridTime.
Time when the most recent full compaction was completed. Raw representation of a HybridTime.
Overall full compaction state of the table.
Full compaction statuses of all tablet replicas.
(message has no fields)
Someone started running initdb, as indicated by the existence of template1.pg_proc.
This is true if the master ran initdb and it finished, successfully or not.
If this is set to a non-empty string, initdb has failed.
UUIDs of the tservers being taken down.
UUIDs of the masters being taken down.
(message has no fields)
(message has no fields)
(message has no fields)
(message has no fields)
(message has no fields)
(message has no fields)
(message has no fields)
(message has no fields)
Read mode: if value is unset, this mode is used. Write mode: if value is set, it will be written to the register.
Read mode: value is read from the register. Write mode: value is read from the register before write.
required
required
required
required
required
Number of YSQL backends (across all tservers) that have not reached the requested catalog version. If the field is -1, the counting is in-progress.
Client->Master RPCs
Can be removed once 2024.2 is out of support (usage removed in D37010).
Automatically add table indexes into the snapshot.
Interpet this snapshot as imported: Snapshot will be created as COMPLETE and no tablet operations will be performed.
Create snapshot to this schedule. Other fields are ignored.
Automatically add used User Defined Types into the snapshot. This is for YCQL only. For YSQL it's no-op currently because YSQL does not use SysUDTypeEntryPB records in the SysCatalog.
Number of hours the snapshot needs to be kept around before it is deleted. Set to -1 to retain indefinitely until an explicit delete_snapshot.
16 bytes UUID
16 bytes UUID
Absolute Timing Option: Max HybridTime, in Micros.
16 bytes UUID
16 bytes UUID
When snapshot_schedule_id is not specified, all schedules are listed.
Absolute Timing Option: Max HybridTime, in Micros.
16 bytes UUID
If the call returned without error, then these are the fields to pass to ListClones.
Client->Master RPCs
The tablet IDs about which to fetch info.
If table ID is specified, table's partition_list_version will be included into response.
If true, then return any hidden tablets as well.
If true, then return any deleted tablets as well (marked with is_deleted in the returned tablet locations).
If GetTabletLocationsRequestPB::table_id is set we return table's partition_list_version for this table (see SysTablesEntryPB::partition_list_version).
Partition-key range.
If true, then return all tablets associated with the table - including parents of splits that have not yet been deleted. Result could have overlapping partition key ranges.
When set, the TabletLocationsPBs in the response will only have basic fields and partition-related fields set. The fields set are table_id, tablet_id, partition, split_depth, split_parent_tablet_id, and stale.
The error, if an error occurred with this request.
See SysTablesEntryPB for field with the same name.
Placement to use when deciding which local transaction tables should be considered. No local transaction tablets will be returned if not set.
For Postgres:
Reserve Postgres OIDs
The namespace ID of the Postgres database.
The minimum next OID to reserve.
The number of OIDs to attempt to reserve.
use_secondary_space is used by xCluster when a database is a target.
The error, if an error occurred with this request.
The beginning oid reserved. Can be higher than requested.
The end (exclusive) oid reserved.
How many universe-wide OID cache invalidations happened before this allocation was done.
(message has no fields)
The ordering of the indexes' results here is expected to be the same as the ordering in the corresponding request PB (GetIndexBackfillProgressRequestPB).
Redis Config
Administrative/monitoring RPCs
If set to true, return only the tservers which are in the primary/sync cluster.
If replication_info is not provided, tablespace ID will be used to fetch the replication config on user tables that are geo-partitioned within a tablespace.
Replication config will be used on user tables that are located in geo-partitioned tablepsace to filter TServers based on their placement ID and cloud config.
If set to true, return only the live tservers which are in the primary/sync cluster.
ListMastersRequest/Response: get information about all of the known master servers, including this node from the in-memory options.
(message has no fields)
An entry for each individual master server.
Set only if there's an error in retrieving the list of servers or in getting this server's own local registration information.
ListMasterRaftPeersRequest/Response: get information about all of the known servers which are part of this master's version of the currently active Raft quorum. This also captures any inflight change config operations which are not yet tracked by in-memory options and hence can give a more current picture of peers compared with ListMastersResponse.
(message has no fields)
An entry for each individual master server.
Set only if there's an error in retrieving the list of servers or in getting this server's own local registration information.
GetMasterRegistrationRequest/Response: get the instance id and HTTP/RPC addresses for this Master server.
(message has no fields)
TODO: Just use ServerRegistration here.
Node instance information is always set.
These fields are optional, as they won't be set if there's an error retrieving the host/port information.
This server's role in the consensus configuration.
Set if there an error retrieving the registration information.
(message has no fields)
(DEPRECATE_EOL 2025.1)
When force is set, the config version is bumped up even if no new flags are eligible for promote.
Get the ready status from the catalog manager for this master. NOTE: Should be used only for unit testing purposes.
Get a master's notion being ready as the leader. NOTE: Should be used only for unit testing purposes.
(message has no fields)
When no errors, the master will be deemed ready as per its catalog manager layer.
Dump master state from all the peers in the current master's quorum
Make the masters dump all their in-memory and on-disk state to their respective log files. Sent to the master leader first, and then propogated to its peers if peers_also is set to true.
Dump on-disk state known to this master - including sys.catalog and raft config related info
If set to true, the leader sends request to all current peers to dump their state too. The on_disk is sent along to peers too.
If set to true, the dump will be returned back as a string in the response. Else the dump will be saved into the master respective log files.
(message has no fields)
Update an ex-peer about its removal from the cluster.
(message has no fields)
(message has no fields)
(message has no fields)
Get the percentage of tablet data that got moved as part of a blacklist config change. Handled by the master leader and picked up by new leader on failover.
(message has no fields)
Get the percentage of tablet leadership that got moved as part of a leader blacklist config change. Handled by the master leader and picked up by new leader on failover.
(message has no fields)
When no errors, the master leader will have balanced all the load across the live tservers. The client can send in an optional value for the expected number of servers. If the master finds fewer alive in its snapshot than these, it will consider the load imbalanced.
Any error being set implies that the load is not balanced across the servers.
Is load balancer idle.
(message has no fields)
When no errors, load balancer is idle.
(message has no fields)
Any error being set implies that the leader load is not balanced across the servers.
(message has no fields)
Only valid if role is not LEADER.
Authentication and Authorization.
Name of the role creating this role.
The error, if an error occurred with this request.
Name of the role trying to alter the role.
The error, if an error occurred with this request.
Name of the role trying to drop the role.
The error, if an error occurred with this request.
true if this is a revoke request.
The error, if an error occurred with this request.
true if this is a revoke request.
The error, if an error occurred with this request.
Only get the permissions if the cache version in the master is greater than this version.
Create table request (including index table)
Specifies number of tablets to create. If it's not set here 'SchemaPB::TablePropertiesPB::num_tablets' from 'schema' field will be used.
For index table.
Indexed table id of this index.
Is a local index?
Is a unique index?
Skip online schema migration for
index?
Defer backfill for batching later?
For RBAC.
For Postgres:
id to assign to this table.
Is this a sys catalog table?
Is this a shared table?
Is this a colocated table? This field is only applicable for a colocated database.
This is only applicable for tablegroups. Eventually colocated will be deprecated.
Colocation ID to distinguish a table within a colocation group. Auto-generated by catalog manager if not specified. Only makes sense for colocated tables.
For YSQL tables, transaction used by this DDL. If aborted, table will be removed.
For YSQL tables, this denotes the tablespace that this table is associated with.
This field should be used to create or restore table with a fixed set of partitions.
In case the table was rewritten, explicitly store the TableId containing the PG table OID (as the table's TableId no longer matches).
Used during table rewrite - the TableId of the old DocDB table that is being rewritten.
Set to true when the table is being re-written as part of a TRUNCATE operation.
The error, if an error occurred with this request.
The error, if an error occurred with this request.
true if the create operation is completed, false otherwise
When used, only returns tables that satisfy a substring match on name_filter.
Can be used to list tables for this one particular namespace.
Exclude system tables.
Can be used to filter tables based on RelationType
The error, if an error occurred with this request.
The error, if an error occurred with this request.
List of all tables in this tablegroup.
The error, if an error occurred with this request.
List of all colocated user tables in this colocated database.
The error, if an error occurred with this request.
The error, if an error occurred with this request.
true if the truncate operation is completed, false otherwise
The index to backfill. Used for YSQL
The error, if an error occurred with this request.
The indexed table to backfill.
The indexed table identifier. Used for YCQL tables from yb-admin.
The error, if an error occurred with this request.
The indexed table identifier. Used for YCQL tables from yb-admin.
The error, if an error occurred with this request.
A list of index tables whose backfill status should be returned. Either table_id or a pair of table_name and namespace should be specified to identify a table.
Delete table request (including index table).
The error, if an error occurred with this request.
table_id for the requested table.
Deleted table ids. Includes the requested table, and also any index tables that it may have.
For index table, the indexed table of this index.
The error, if an error occurred with this request.
true if the delete operation is completed, false otherwise
If set to true, SendAlterTableRequest will be sent even if no changes are specified in this request. This is useful to trigger index permissions update.
Replication information for this table.
This is the transaction performing the Alter operation. This is used by TServers to abort any ongoing DML on the table other than this transaction.
If set, updates the pgschema_name in SchemaPB.
Used for YSQL to notify DocDB of DDL changes that affect only PG metadata
If set, YB-Master will poll the status of 'transaction' and rollback the Alter if failed.
For CDCSDK Stream creation with consistent snapshot
The error, if an error occurred with this request.
The error, if an error occurred with this request.
this is the current schema, or the 'new' schema version if an alter is in progress
true if the alter operation is completed, false otherwise
============================================================================ Namespace (default namespace = ANY placement) ============================================================================ Database type is added to metadata entries such that PGSQL clients cannot delete or connect to CQL database_type and vice versa.
Namespace name.
Database type.
For RBAC.
For Postgres:
id to assign to this namespace.
namespace id of the source database to copy from.
Next oid to assign. Ignored when source_namespace_id is given
and the next_pg_oid from source namespace will be used. DDL Dependent upon Transaction success (abort removes). Used by YSQL.
True if the namespace is colocated.
The error, if an error occurred with this request.
The error, if an error occurred with this request.
true if the create operation is completed, false otherwise
Database type is added to metadata entries such that PGSQL clients cannot delete or connect to CQL database_type and vice versa.
Database type.
The error, if an error occurred with this request.
The error, if an error occurred with this request.
true if the delete operation completed, false otherwise
New name for the namespace in the alter operation.
The error, if an error occurred with this request.
The error, if an error occurred with this request.
We use int32 because the repeated bool type is bugged. See https://github.com/yugabyte/yugabyte-db/issues/15868
GetTableDiskSizePB used for YSQL \d+ command
The error, if an error occurred with this request.
Size is 0 for colocated tables
For Tablegroup:
These two fields ensure that YB-Master will poll the status of 'transaction' and delete the tablegroup if aborted.
This denotes the tablespace that this tablegroup is associated with.
The error, if an error occurred with this request.
These two fields ensure that YB-Master will first mark the tablegroup for deletion, poll the status of 'transaction' and rollback the marker if failed. Otherwise deletion of the tablegroup will be initiated upon receipt of this request.
The error, if an error occurred with this request.
The error, if an error occurred with this request.
The error, if an error occurred with this request.
The error, if an error occurred with this request.
The error, if an error occurred with this request.
The error, if an error occurred with this request.
The transaction whose status is being reported.
Whether the above transaction is committed or aborted.
The lease epoch of the requesting tserver.
The lease epoch of the requesting tserver.
Should generally not be used. Only used by yb-admin to manually clear out locks (that may have leaked).
(message has no fields)
(message has no fields)
(message has no fields)
TS->Master RPCs
Heartbeat sent from the tablet-server to the master to establish liveness and report back any status changes.
Sent upon start-up of the TS, or in response to 'needs_reregister' on a heartbeat response.
Sent when the tablet information has changed, or in response to 'needs_full_tablet_report'.
The number of tablets that are BOOTSTRAPPING or RUNNING. Used by the master to determine load when creating new tablet replicas.
Number of tablets for which this ts is a leader.
Physical time on tablet server
Hybrid time on tablet server
Roundtrip time for previous heartbeat in microseconds.
Drive metadata. Only set in the metrics heartbeat.
Tablet server has at least one faulty drive.
Indicates that the server which heartbeated needs to re-register with the master -- i.e send a heartbeat with the 'registration' filled in.
Sent when the master receives a TabletReport
Specify whether or not the node is the leader master.
Piggyback the current config as known to the master leader.
List of all live nodes that the master knows about.
Cluster UUID. Sent by the master only after registration.
Current YSQL catalog schema version. Used by tservers and postgres backends to decide if a cache refresh is needed. In per-db catalog version mode, db_catalog_version_data will be used instead.
Version of transaction tables and their placements, so that the TS knows when to update the cached list of status tablet ids in the transaction manager.
Specify whether or not the cluster is a producer of a valid replication stream.
Map[Local NamespaceId]: xCluster safe read HybridTime
Only set if error is set. When set, indicates that the yb-master believes the server to be in a severe bad state and should be immediately shutdown.
Tablet-level Replication.
CDC stream RPCs.
[default = false]
cdcsdk_stream_create_options field should be used for adding more stream creation options related to CDCSDK in future.
The error, if an error occurred with this request.
The error, if an error occurred with this request.
The error, if an error occurred with this request.
The error, if an error occurred with this request.
The error, if an error occurred with this request.
For batch update.
The table namespace (if empty - uses default namespace).
if set, metadata only of this type will be fetched.
The error, if an error occurred with this request.
The error, if an error occurred with this request.
This is the schema that every TS should be able to understand if your alter is keeping the schema compatible. In case of an alter table in progress, this is the previous schema; otherwise it is the latest schema.
Table schema version
Is the created replication group transactionally consistent.
[default = false]
An id generated by the producer when BootstrapProducer rpc is called.
Is the created replication group transactionally consistent.
[default = false]
Used for DB Scoped replication. transactional must be set. Both id and name must be set. Only YQL_DATABASE_PGSQL are allowed.
Whether automatic DDL replication is enabled - Creates the yb_xcluster_ddl_replication extension and sequences_data table. Requires DB Scoped replication, transactional and producer_namespace to be set.
[default = false]
Used to validate that the request is sent to the correct universe.
producer_namespace_id -> oid_to_bump_above
In case force is set, then still return any ignored warnings.
The below options are currently mutually exclusive. Only 1 operation at a time.
Optional bootstrap ids for the add table operation.
Used to validate the requests are sent to the correct universe.
Used for DB Scoped replication. Both id and name must be set. Only YQL_DATABASE_PGSQL are allowed.
True if the bootstrapping is complete, false otherwise.
The current state of the bootstrap.
The more specific error that occurred during replication, or OK if we succeeded.
True if the universe is properly setup for replication, false otherwise.
The more specific error that occurred during replication, or OK if we succeeded.
The last Consumer schema version that was EquivalentForDataCopy with the Producer
If this is an alter on a colocated table, then this is the colocated parent table id, and we also need to specify the colocation_id.
[default = false]
Filters by the replication group if non-empty.
(message has no fields)
Ignore safe times from these types of tables. If this filters out all tables, then will return master leader safe time.
Minimum time after which data is available on all the bootstrapped streams.
Backfill a replication slot name to an existing CDCSDK stream.
xClusterOutboundReplicationGroup RPCs.
[default = false]
Optional. When set target cluster is also cleaned up.
Optional. When set target cluster is also cleaned up.
Only one of the following fields should be set. If both are empty, return all tables.
[default = false]
[default = false]
[default = false]
xCluster APIsV2
[default = false]
Only set when done is true. OK if the created succeeded or the error if it failed.
[default = false]
Only set when done is true. OK if the created succeeded or the error if it failed.
Introduced for bug (#22876, #22773)
Introduced for bug (#22876, #22773)
Introduced for bug (#22876, #22773)
Introduced for bug (#22876, #22773)
Returns TryAgain error until specified number of calls is done.
UUID of server this request is addressed to.
See TestRetry RPC method description below.
Used in:
The schema to add. NOTE: the 'id' field of the schema should not be provided here -- the server will assign an ID.
Used in:
Name of the column to drop.
Used in:
Name of the column to rename;
Used in:
Name of the column for which to update the pg_type_oid.
Used in:
Exactly one of the following must be set, based on 'type'
Used in:
TODO(KUDU-861): this will subsume RENAME_COLUMN, but not yet implemented on the master side.
Used in:
,Index's TableId -> State for each index.
Number of rows processed for this backfill task (the same for all indexes)
Used in:
Used in:
Used to disambiguate in case YSQL tables in different schema have same name.
For 'entry.type' == TABLE only.
This is used to mark servers in the load balancer that should be considered for immediate removal of load and also prevented from being assigned any new load.
Used in:
Fields to track the number of replicas/leaders in current set of tablets which have a blacklist server/leader. Client should not set this. Set by server side when persisting the blacklist load.
The on-disk entry specific to CDCSDK streams
Used in:
Used in:
This field stores the type of the LSN being used by the replication slot.
Used in:
,For CDCSDK, table_id contains the qualified list of tables for the stream.
[default = false]
This map stores the replica identity for each table in the stream at the time of stream creation. The key for this map is table_id and the value is replica identity for that table.
Dynamic tables are the tables which are created after the creation of the stream. This field controls if dynamic tables should automatically be added to the CDC stream or not. If set to true, dynamic table wont get added to the CDC stream.
This field stores the list of user created tables that have been removed from CDCSDK stream.
Field to store all the metadata related to a CDC stream.
Options for CDC stream. This will include details such as: Stream sink: YB Universe / Kafka / Elastic Search. Log retention time: Amount of time to retain logs for CDC. Sink details: For example, Kafka cluster IP, port.
Used in:
, ,Used in:
Used in:
Set by DDL Replication to link the table to the original table in the source cluster.
Set by DDL Replication as a set time to perform index backfill.
Used in:
Used in:
Used in:
Used in:
Current full compaction state.
Time of completion of the last fully completed full compaction. Raw representation of a HybridTime.
Used in:
When no errors, the percent reflects the progress of load removal from the blacklisted tservers.
Used as response type in: MasterCluster.GetLeaderBlacklistCompletion, MasterCluster.GetLoadMoveCompletion
To be deprecated. Replaced by "100 * (total - remaining) / total".
Used in:
Used as response type in: MasterDdl.GetNamespaceInfo
Used as field type in:
The error, if an error occurred with this request.
This denotes if a colocated database is a legacy colocated database.
Used as response type in: MasterDdl.GetTableSchema
Used as field type in:
, ,The error, if an error occurred with this request.
This is the schema that every TS should be able to understand if your alter is keeping the schema compatible. In case of an alter table in progress, this is the previous schema; otherwise it is the latest schema.
Table schema version
The table's partition schema.
True if the create operation is completed, false otherwise.
The table type.
Table identifier
Secondary indexes of the table.
For index table: [to be deprecated and replaced by "index_info"]
Indexed table id of this index.
For index table: information about this index.
True if table is colocated (including tablegroups, excluding YSQL system tables).
If the table is rewritten, this field explicitly stores the PG table id.
Added on Oct 2024 (v2025.1). This will not be set on versions before this change, and there is no direct AutoFlag protecting this, so use with caution.
[default = false]
Used in:
Used in:
Used in:
Used in:
Map of Source TableId to xCluster StreamId
Used in:
Used in:
Used in:
ID mapping pair: old ID (object ID on external cluster) TO new ID (same object ID on this cluster)
Used in:
Used in:
Per table IDs mapping (IDs on external cluster TO IDs on this cluster).
Used in:
Used in:
Used in:
Contains an error if it's not possible to get backfill_status and index permissions.
Backfill status for the specified index table on base of index permissions. Value absence means either error field is specified, or backfill_status is not present in BackfillStatus enum.
Used in:
Unspecified state.
Backfill succeeded.
Used in:
Used in:
Used in:
Defaults are set to true to support backwards compatibility.
Used in:
Used in:
Used in:
Master specific errors use this protobuf.
Used in:
, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,The error code.
The Status object for the error. This will include a textual message that may be more useful to present in log messages, etc, though its error code is less specific.
Used in:
An error which has no more specific error code. The code and message in 'status' may reveal more details. RPCs should avoid returning this, since callers will not be able to easily parse the error.
The schema provided for a request was not well-formed.
The requested table or index does not exist
The name requested for the table or index is already in use
The number of tablets requested for a new table is over the per TS limit.
Catalog manager is not yet initialized.
The operation attempted can only be invoked against either the leader or a single non-distributed master, which this node isn't.
The number of replicas requested is greater than the number of live servers in the cluster.
Change config should always be issued with the latest config version set. If the client fails to do so, or there is a concurrent change, we will set this error code.
If there is an operation in progress causing the current rpc to be in an indeterminate state, we return this error code. Client can retry on a case by case basis as needed.
Invalid namespace name or id for the namespace operation.
Client set some fields incorrectly in the cluster config proto.
Indicator to client that the load balance operation can be retried.
Invalid (User-Defined) Type operation
Snapshot related errors.
Roles and permissions errors.
Indicator to client that the are leaders on preferred only operation can be retried.
Indicator to client that load balancer was recently active.
Client set some fields in the table replication info incorrectly.
Error in case a tablet-level operation was attempted on a tablet which is not running.
The number of existing replication slots have reached `max_replication_slots`.
Used in:
Used in:
, , , , , , , , , , , , , , , , , , , , ,The namespace ID to fetch info.
The namespace name to fetch info.
Database type.
Used in:
Used in:
PG composite type oid.
Attributes of composite type.
Used in:
PG enum Oid.
PG enum label.
Used in:
Used in:
TODO: If this ends up being too big, consider adding a way to break this up into multiple messages.
Used in:
,Used in:
Used in:
Used in:
The latest _committed_ consensus state. This will be missing if the tablet is not in a RUNNING state (i.e. if it is BOOTSTRAPPING).
Replica is reporting that load balancer moves should be disabled
Is the tablet hidden.
Mapping of table ids to their respective schema version numbers.
Used in:
Used in:
Bitmap representing the permissions.
Used in:
Used in:
,The amount of memory the TServer has reserved for tablet overheads.
Used in:
Detailed snapshot entries.
Used in:
Bitmap representing the permissions for 'ALL KEYSPACES' and 'ALL ROLES'.
Used in:
,Used in:
, ,Detailed snapshot entries.
Specifies what format of snaphot info is provided. The current versions are: Format 0 - latest format (== Format 3 at the moment). Format -1 - old format (no 'namespace_name' in the Table entry). Format 1 - old format (no BackupRowEntryPB. Instead, namespaces, tables, and tablets are stored in SysSnapshotEntryPB entry.entries). Format 2 - Using BackupRowEntryPB wrapper which has pg_schema_name for ysql table entries. Format 3 - Using relfilenode for import snapshot in Ysql databases. This format guarantees that a ysql_dump taken for a backup preserves relfilenode for ysql tables.
Stored extended info about snapshot (1) namespaces (2) tables (3) tablets instead of 'SysRowEntry entry.entries'.
Used in:
Used in:
,Used in:
,interval for taking snapshot in seconds.
how long store snapshots in seconds.
hybrid time when this schedule was deleted.
list of all restorations of this schedule.
Used in:
The data part of a SysRowEntry in the sys.catalog table for a CDC stream.
Used in:
,[default = false]
This map stores the replica identity for each table in the stream at the time of stream creation. The key for this map is table_id and the value is replica identity for that table.
Dynamic tables are the tables which are created after the creation of the stream. This field controls if dynamic tables should automatically be added to the CDC stream or not. If set to true, dynamic table wont get added to the CDC stream.
This field stores the list of user created tables that have been removed from CDCSDK stream.
Used in:
,Used to mark a stream that has been bootstrapped, but hasn't started streaming yet.
Currently DELETED is not being used because we delete streams entries from sys catalog.
Used to handle the stream metadata cleanup as part of drop table.
Used in:
Used in:
Needed to load the clone state into the CloneStateManager's map.
Used for debugging.
A reason for why the clone was aborted.
State for clone operation. CLONE_SCHEMA_STARTED: Initial state. CLONE_SCHEMA_STARTED --> CREATING: Once DB objects have been created by ysql_dump (YSQL) or ImportSnapshot (YCQL). Clone tablet RPCs are scheduled for all tablets. CREATING --> RESTORING: All tablets in clone namespace are created and in a running state. Restore snapshot is issued. RESTORING --> COMPLETE (YCQL): Restore snapshot completed and DB is ready to be accessed. RESTORING --> RESTORED (YSQL): Restore snapshot completed. RESTORED --> COMPLETE (YSQL): DB is ready to be accessed.
Used in:
The on-disk entry in the sys.catalog table for configuration information that are relevant to the entire cluster. This has a version entry that is used for ensuring that client read-modify-writes are valid.
Used in:
,This field is only generated internally by the master leader in PrepareDefaultClusterConfig (as opposed to cluster_uuid which can be passed in as a flag). If not already set, it is set on the VisitSysCatalog path.
This field is bumped to invalidate all the TServer OID caches. Note that this is for every database and applies only to YSQL.
Various cluster configuration.
The data part of a SysRowEntry in the sys.catalog table for a namespace.
There are significant differences between the state machines for YSQL vs non-YSQL. The additional complexity for YSQL is due to the amount of work required for database creation and deletion, requiring async tasks and additional states.
Namespace name.
Namespace/Database type.
For Postgres:
Next normal space oid to assign.
True if the namespace is colocated.
Optional: Namespace dependent upon transaction success (abort removes NS). Used by YSQL.
Next secondary space oid to assign.
During the deletion flow a non-YSQL namespace is removed from the maps and sys catalog table directly instead of transitioning to any deletion states.
Used in:
During a YSQL major version upgrade, for example from PG11 to PG15, we use the existing namespace entry for both the old and new versions' namespace. However, PG's upgrade process is normally run on a clean unused system, and it does DROP DATABASE and CREATE DATABASE there in order to fully restore the properties of the database. In YB, we simulate PG's environment, by using a separate state for the new major version. NEXT_VER_RUNNING is the initial state. NEXT_VER_RUNNING -> NEXT_VER_DELETING - deletion requested. NEXT_VER_DELETING -> NEXT_VER_DELETED - happy path of deletion. NEXT_VER_DELETING -> NEXT_VER_FAILED - unhappy path of deletion. NEXT_VER_DELETED -> NEXT_VER_RUNNING - re-populated. TODO: Change the initial state to something other than NEXT_VER_RUNNING. Be sure it makes sense for multiple upgrades (e.g., a system that went from PG11 -> PG15 -> PG17). Therefore it may need to be changed from NEXT_VER_RUNNING at some point after the upgrade.
Used in:
lease_epoch -> Transaction ...
Used in:
Whether the lease is currently live.
The instance_seqno of the tserver process to which this lease was granted.
Used in:
Used in:
object_id -> Locks taken
Used in:
subtxn -> object locks ...
Used in:
txn_id -> subtxn ...
The data part of a SysRowEntry in the sys.catalog table for Redis Config.
Used in:
Time when restoration finished. Computed on master after received response from the last tablet.
The actual on disk abstract representation of a row in the sys catalog. This has to respect the fixed schema of the catalog. In case of changes to the schema, this proto must reflect them.
Used in:
, ,The type of entry we are storing. Since the data is serialized, we cannot just store it with the data, as we are not able to read into the appropriate type.
The optional ID of the data that we are storing. This can be useful to only read information related to a single item, in the case of tables or tablets, for example. This is optional.
This is the serialized format of the proto we store. This used to be of the "string" type, but was giving warnings due to non-UTF8 data. This is safe, because "bytes" and "string" are encoded the same way in Protobuf. https://groups.google.com/forum/#!msg/protobuf/au6eQBkRT5s/Bhpctql7Q5sJ
Used in:
, , , ,Cluster security configuration.
Used in:
Roles configuration version. Every time a role gets created/deleted, or a permission gets added/removed, we increase the version.
The on-disk entry in the sys.catalog table ("metadata" column) for snapshots entries.
Used in:
Stored info about snapshot (1) namespaces (2) tables (3) tablets.
This field specifies the TTL of this snapshot. 1. Not set: the snapshot has no explicit TTL, will be retained until a DeleteSnapshot, and does not block object cleanup. This is used to handle a few special cases: a. Snapshots which are part of a snapshot schedule do not have this field set. This is because their TTL is controlled by the snapshot schedule's retention. b. Snapshots created before D28005 (when this field was introduced). 2. < 0: the snapshot will not be automatically cleaned up until a `DeleteSnapshot`, and might block object cleanup until then. 3. > 0: the snapshot will automatically be cleaned up when now() > snapshot_hybrid_time + retention_duration_hours. 4. 0: explicitly forbidden.
Whether this is an imported snapshot (part of a restore). Default is false to maintain historical behavior when deciding whether to block object cleanup.
Used in:
, , ,Used in:
The on-disk entry in the sys.catalog table ("metadata" column) for tables entries.
Table name
Table type
The table namespace ID.
The table namespace name.
sequence-id for the table metadata. Used on tablet-report to avoid sending "alter-table" notifications.
Newest table schema (every TS will eventually have it).
Last table schema that is guaranteed to have reached every TS, though not necessarily the newest schema. This is the schema provided to the user on client->GetSchema(tableName).
The table's partitioning schema.
The table's partitions version. Incremented each time partitions change.
The next column ID to assign to newly added columns in this table. This prevents column ID reuse.
Replication information for this table.
Debug state for the table.
TODO(neil) OLDER INDEXes will always have the deprecated fields. To remove the old format, we first need to come up with a way to convert existing catalog content to new format. Secondary indexes of the table.
For index table: [to be deprecated and replaced by "index_info"]
Indexed table id of this index.
Whether this is a local index.
Whether this is a unique index.
For index table: information about this index.
For Postgres:
Is this a shared table?
True if the table is colocated (including tablegroups, excluding YSQL system tables).
If the table is colocated and is not the parent table of the colocated tablet, contains the table id of the parent table.
For materialized views:
True if the table is a materialized view.
In case the table was rewritten, explicitly store the TableId containing the PG table OID (as the table's TableId no longer matches).
During an alter table, which involves no schema change but only updating a permission, is it sometimes acceptable for a client's request (which is prepared with the current schema) to be accepted by a tserver which is still running the previous version. This is typically set during alters that are caused due to index permissions being changed, when the table is backfilled.
Keeps track of in-progress backfill jobs. As of Apr 2021, we only have at most one outstanding backfill job, but this restriction may be removed later on. Hence repeated.
Tablespace ID for use with transaction tables only. Normal YSQL tables do not set this field, and tablespace information for such tables are instead fetched by scanning the pg catalog.
Time when the table was hidden.
State that indicates that this table is being changed by a YSQL transaction. This repeated field contains only a single element as of now. When we support DDL + Savepoints, we will have one element for every savepoint modifying this table in this field.
YSQL transaction that is currently modifying this table state. The changes being performed by it are detailed in 'ysql_ddl_txn_state' above.
Time when an admin compaction was last requested. Raw representation of a HybridTime.
Used in:
Used in:
,Used in:
Set by DDL Replication to link the table to the original table in the source cluster. Cleared after table creation completes.
Stores a list of old schema packings for automatic mode xCluster target colocated tables. These tables are processed before being created and require a source->target packed schema mapping. To handle this, we store processed schemas and insert them as old_schema_packings when the table is created. This allows us to have schema versions to use for the mapping that persists before and after the table is created. This is cleaned up after the table is created.
If set, use this time for the index backfill time.
The instance_seqno of a tserver is chosen at process start and is constant throughout the process lifetime. It must be monotonically increased across process restarts for a given UUID.
Contains ip addresses, ports, cloud info, and placement_uuid.
The resources (cpu & memory) available at the tserver. Used by the tablet limits machinery.
If true, this entry has been written to the sys catalog. Because the flag that enables writing these entries to the sys catalog is a runtime flag, this field is used to force tservers which registered in memory before persistence was enabled to re-register and have their entry persisted.
Used in:
Proto best practices are to include a sentinel as the first enum value. See https://protobuf.dev/programming-guides/dos-donts/#unspecified-enum
A heartbeat from the TServer has been ACK'd recently.
No heartbeat from the TServer has been ACK'd within at least tserver_unresponsive_timeout_ms.
Another tserver which started more recently has registered with a conflicting address. Heartbeats from this TServer will be ignored until it restarts with a greater instance_seqno. This is currently used to deal with TServers rebooted after a disk wipe. In this case the new TServer process generates a new UUID and is recognized as a new TServer by the master leader. The old TServer entry is put into this state when the new TServer process registers.
The tserver has been removed from the cluster. This state is not persisted to raft, instead the entry is deleted. This state signals to code that holds on to a shared_ptr<TSDescriptor> that the object representing the tablet server is stale and should not be used.
The on-disk entry in the sys.catalog table ("metadata" column) for tablets entries.
DEPRECATED. Replaced by 'partition'.
Tablet partition.
The latest committed consensus configuration reported to the Master.
Debug state for the tablet.
The table id for the tablet.
Table ids for all the tables on this tablet.
True if the tablet is colocated.
Replaced by the map below.
For tablets that are results of splitting we set this to split parent split_depth + 1.
If the tablet is in the backfilling state, this is used to keep track of how far along backfill has completed. Key corresponds to the table_id for the index table. Value is encoded as the DocKey for the next row to be backfilled.
Tablet IDs for the children of this tablet after splitting. It is possible for a tablet to temporarily exist in this field but not be registered as part of the table or the catalog manager's tablet map.
Time when tablet was hidden.
If tablet was hidden instead of deleting, here we keep list of schedule ids that prevented actual deletion.
Describes the persisted mapping scheme for colocated tablets. If set, the table_ids field of this tablet is empty and child tables on this tablet have their parent_table_id field filled. The table_id field of all tablets is filled with the parent table id. So the list of tables hosted on this tablet is computed at load time by finding all child tables of the parent table of this tablet.
Whether this tablet was created by DB cloning. If true, we should not try to send CreateTablet requests for this tablet (it should be created by tservers applying the clone op).
Used in:
Metadata about the current state of transaction tables.
Used in:
Transaction status tables version. Every time a transaction table is added or has its placement changed, this version gets incremented.
The data part of a SysRowEntry in the sys.catalog table for a User Defined Type.
The data part of a SysRowEntry in the sys.catalog table for a universe replication record.
There's different cleanup tasks depending on which state the flow failed on, and so we store this on failure so that we can cleanup properly.
producer table ID -> producer CDC stream ID map.
In the xCluster native bootstrap flow, during the ImportSnapshot step the consumer universe actually creates its own snapshot with a unique ID. In this case, old_snapshot_id is the producer snapshot ID and new_snapshot_id is the consumer snapshot ID.
Keeps track of newly created objects in case we need to cleanup on failure.
Set when consistent transactions are enabled for a replication group.
[default = false]
According to https://phorge.dev.yugabyte.com/D24796, async tasks that require epoch should retrieve it from the context that initiated the work. These values store the epoch values passed from the initial RPC call to SetupNamespaceReplicationWithBootstrap.
The following PBs are used to represent the newly created objects during CatalogManager::ImportSnapshotMeta. Specifically, these are all the required fields used in CatalogManager::DeleteNewSnapshotObjects. We store these PBs in case we need to cleanup on failure.
Used in:
, ,Used in:
Used in:
Used in:
,Setting up replication.
Bootstrapping CDC streams on producer universe.
Creating snapshot on producer universe.
ImportSnapshotMeta on consumer universe.
CreateSnapshot on consumer universe, marking it as imported. This is the same logic that occurs in the yb-admin import_snapshot command.
Downloading snapshot files from producer to consumer.
Restore snapshot on consumer universe.
Call SetupUniverseReplication on consumer universe.
Bootstrap is complete.
Bootstrap failed on some task.
Deleted.
Error while cleaning up state of deleted entry. This indicates that universe replication has been deleted but there is still some uncleaned up state - for example, there may be left over CDC streams.
Unfinished Delete
Used in:
Indexed table id of this index.
Used in:
The data part of a SysRowEntry in the sys.catalog table for a universe replication record.
Used in:
producer table IDs.
producer table ID -> consumer table ID map.
producer table ID -> producer CDC stream ID map.
Set when consistent transactions are enabled for a replication group.
[default = false]
DB Scoped repication.
Used in:
[default = false]
Target namespace id -> TargetNamespaceInfoPB.
Used in:
Used in:
Used in:
Colocation id to historical schema packings mapping.
Used in:
Setting up replication.
Validated table schemas.
Active.
Failed. Setting up universe replication consists of a sequence of steps like validating schemas, creating CDC streams, starting subscribers. If any of these fail, we set the universe replication state to FAILED.
Disabled.
Deleted.
Error while cleaning up state of deleted entry. This indicates that universe replication has been deleted but there is still some uncleaned up state - for example, there may be left over CDC streams.
Unfinished Delete
Used in:
Local NamespaceId -> xCluster info for that namespace.
Namespace Id -> NamespaceInfoPB
[default = false]
Used in:
Table id -> TableInfoPB
[default = false]
Set when state is FAILED
Used in:
Used in:
[default = false]
Was this stream checkpointed as part of the initial bootstrap, or was it added later by a newly created table?
Used in:
Used in:
Set when status is FAILED
Used in:
Metadata about the YSQL catalog (current only version).
Used in:
YSQL catalog version. Every time the catalog tables are changed (i.e. by DDL statements) this version gets incremented.
This is true if the master ran initdb and it finished, succesfully or not.
If this is set, initdb has failed.
true if transactional system catalogs have been enabled on this cluster. This means all YSQL system catalog tables have been made transactional, both in their schema and in the tablet metadata.
Used in:
Local NamespaceId -> xCluster info for that namespace.
Info about a single tablet server, returned to the client as part of the GetTabletLocations response. This can be used on the client to update the local cache of where each TS UUID is located. In the future we may also want to transmit software version info, load info, topology, etc.
Used in:
Used in:
Sent by the TS when it first heartbeats with a master. This sends the master all of the necessary information about the current instance of the TS.
Used in:
, , ,Resources available at the tserver.
Used in:
16 bytes for UUID.
Used in:
Used in:
Last restorations update hybrid time.
Restorations info.
Common information sent with every request from the tablet server to the master.
Used in:
The instance of the tablet server sending the heartbeat.
Used in:
,Used in:
Device path provided by user in --fs_data_dirs
Used in:
, , , , , , , , , , , , , , , , , , , , ,The table ID to fetch info.
The table name to fetch info.
The table namespace (if empty - using default namespace).
Used in:
Used in:
,The tablegroup ID to fetch info.
The tablegroup name to fetch info.
The namespace that the tablegroup is in
Used in:
Used in:
Used in:
, ,DEPRECATED.
true if the tablet was running but no tablet server has reported it yet. The set of replicas will be the last one that was hosting the tablet. This should happen on Master restart when the request is issued before the TS has the time to notify the Master about the tablets that is hosting.
Table ids for all the tables on this tablet.
See SysTabletsEntryPB for fields with the same name.
Number of expected live replicas.
Number of expected read replicas.
Whether or not this tablet has been deleted.
OpId of Committed Raft Config sent back to a tablet server when it requests a meta- -cache refresh. This OpId helps the tablet server determine if its meta-cache entry is stale by comparing this against its current raft_config_opid_index
Used in:
Used in:
Raw representation of a HybridTime.
Sent by the tablet server to report the set of tablets hosted by that TS.
Used in:
If false, then this is a full report, and any prior information about tablets hosted by this server should be dropped.
Tablets for which to update information. If 'is_incremental' is false, then this is the full set of tablets on the server, and any tablets which the master is aware of but not listed in this protobuf should be assumed to have been removed from this server.
Tablet IDs which the tablet server has removed and should no longer be considered hosted here. This will always be empty in a non-incremental report.
Every time the TS generates a tablet report, it creates a sequence number. This can be useful in debugging, and also determining which changes have not yet been reported to the master. The first tablet report (non-incremental) is sequence number 0.
Number of tablets that could not be included in this heartbeat. If 0, then all tablets have been reported to the master.
When we send full report via multiple RPCs, this field will contain sequence_number of the first RPC.
Sent by the Master in response to the TS tablet report (part of the heartbeats)
Used in:
Returns true if the tablet report had to be truncated because master ran out of time.
Used in:
Used in:
,The table ID to fetch info.
The table name to fetch info.
The table namespace (if empty - using default namespace).
Used in:
,Used in:
Metadata regarding replication status of a stream set up on a tablet.
Used in:
Used in:
Used in:
ReplicationGroupId type represented in bytes.
Used in:
Used in:
Used in:
Map[Local NamespaceId]: xCluster safe read HybridTime
Used in:
This matches a row in pg_yb_invalidation_messages table, which has a composite primary key of (db_oid, current_version). For each pair of (db_oid, current_version), there is a list of invalidation messages. The table pg_yb_invalidation_messages also has a message time column that is used to delete old messages from pg_yb_invalidation_messages, but it is not needed by tserver so it is skipped here.
Used in:
Serialized/encoded message list related to PG catalog cache invalidation.
Used in:
,Used in:
This is set when the state is FAILED.
Set to the current version at time of new universe creation. Updated after the ysql major catalog upgrade is complete. This field is introduced in version 15. So universes that are upgraded will have the default value of 11 (the previous version).
[default = false]
Used in:
Used in: