The following table describes some background threads of OBServer and their functions. In most cases, you do not need to be familiar with how these threads are implemented.
Note
Background threads are optimized along with the iteration of OBServer versions. During the iteration process, some background threads may be eliminated or merged, and some new ones may be introduced.
| Thread | Module | Number | Description |
|---|---|---|---|
| TsMgr | Trx | 1 | Refreshes the local cache of the Global Timestamp Service (GTS). |
| WeakReadSvr | Trx | 1 | Calculates the timestamps for local server-level follower reads. |
| HAGtsSource | Trx | 1 | Refreshes ha_gts. The refresh frequency is specified by the gts_refresh_interval parameter. |
| TransCheckpoint Worker | Trx | 1 | Performs operations on transaction checkpoints. |
| GCPartAdpt | Trx | 1 | Regularly checks the all_tenant_gc_partition_info table to obtain the garbage collection (GC) information of partitions. The information can be used to facilitate the GC and two-phase commit of transactions. |
| PartWorker | Trx | 1 | Traverses all partitions on the local OBServer to perform the following operations:
|
| LockWaitMgr | Trx | 1 | Wakes up a thread in the wait lock queue in hotspot row scenarios. For example, it kills a session when the execution of a statement times out. |
| ClogAdapter | Trx | 8 | Asynchronously commits clogs at the transaction layer. |
| ObTransService | Trx | 6 | Performs the following operations:
|
| GCCollector | storage | 1 | Regularly checks whether a GC operation can be performed on all partitions on the local OBServer. If yes, a GC operation is triggered. |
| RebuildSche | storage | 1 | Regularly drives partition tasks that need to be rebuilt. |
| PurgeWorker | storage | 1 | Marks and purges MemTables in the background. |
| DAG | storage | 16 | The worker thread of the directed acyclic graph (DAG). The dag thread performs tasks such as the minor compaction, major compaction, and migration of partitions. |
| DagScheduler | storage | 1 | The scheduling thread of DAG. |
| SSTableChecksumUp | storage | 1 | Batch submits SSTable checksum reporting tasks. |
| PartitionScheduler | storage | 2 | Schedules the minor compaction and major compaction tasks. |
| MemstoreGC | storage | 1 | Recycles the frozen MemStore after a warm-up for minor compaction. |
| ObStoreFile | storage | 1 | Checks for bad macroblocks and recycles macroblocks. |
| PartSerCb | storage | 40 | Schedule 20 threads to handle the switchover of a partition leader. |
| ObPartitionSplit Worker | storage | 1 | Splits a partition in the background. |
| FreezeTimer | storage | 1 | Checks the MemStore memory and triggers a minor compaction. |
| RebuildTask | storage | 1 | Schedules baseline data replicas to pull data. |
| IndexSche | storage | 1 | Schedules the index creation task. |
| FreInfoReload | storage | 1 | Synchronizes the major compaction information in the internal tables. |
| TableMgrGC | storage | 1 | Releases the MemTable and reclaims the memory. |
| BackupInfoUpdate | storage | 1 | Regularly refreshes backup data. |
| LogDiskMon | storage | 1 | Detects the multiple disks of the system. |
| KVCacheWash | storage | 1 | Washes KVCache. The detection interval is specified by the _cache_wash_interval parameter. Value range: [1ms, 1m]. Default value: 200 ms. If you specify a value without a unit, the value is treated as milliseconds. |
| KVCacheRep | storage | 1 | Manages memory fragments of the cache to reclaim the memory. The detection interval is specified by the _cache_wash_interval parameter. Value range: [1ms, 1m]. Default value: 200 ms. If you specify a value without a unit, the value is treated as milliseconds. |
| RSMonitor | RS | 1 | Monitors the status of the current RootServer. |
| CacheCalculator | RS | 1 | Reserves memory for location_cache and schema_cache. |
| ObDailyMergeScheduler | RS | 1 | Schedules the daily major compaction tasks. |
| ObEmptyServerChecker | RS | 1 | Detects whether an OBServer contains replicas. |
| ObFetchPrimaryDDLOperator | RS | 1 | Logically synchronizes the standby cluster to the schema of the SYS tenant of the primary cluster. |
| ObFreezeInfoUpdater | RS | 1 | Speeds up the progress of freeze and manages the snapshot recovery points. |
| ObGlobalIndexBuilder | RS | 1 | Schedules the creation of global indexes. |
| ObGlobalMaxDecidedTransVersionMgr | RS | 1 | Collects the statistics of the versions of global maximum transactions. |
| ObLeaderCoordinator | RS | 1 | Manages the distribution of leader replicas in a cluster. |
| ObLogArchiveScheduler | RS | 1 | Archives the log files. |
| ObMajorFreezeLauncher | RS | 1 | Launches scheduled major compaction tasks daily. |
| ObPartitionSpliter | RS | 1 | Schedules the compaction of partitions. |
| ObRebalanceTaskMgr | RS | 1 | Schedules the execution of load balancing tasks. |
| ObRootBackup | RS | 1 | Schedules backup tasks. |
| ObRootBalancer | RS | 1 | Generates load balancing tasks. |
| ObRsGtsMonitor | RS | 1 | Monitors the distribution of GTS instances and initiates tasks to migrate or generate GTS replicas based on the distribution of GTS replicas. |
| ObRsGtsTaskMgr | RS | 1 | Executes the tasks related to GTS replicas. |
| ObHeartbeatChecker | RS | 1 | Checks the status of inter-OBServer heartbeats. |
| ObStandbyClusterSchemaProcessor | RS | 1 | Synchronizes the replica of a standby cluster to the user tenant schema of the primary cluster. |
| ObRestoreScheduler | RS | 1 | Schedules the recovery process. |
| ObWorkQueue | RS | 4 | Executes asynchronous RootService tasks. The number of threads is specified by the rootservice_async_task_thread_count parameter. Value range: [1, 10]. |
| ObAsyncTaskQueue | RS | 16 | Executes the creation of indexes. |
| ObSwitchTaskQueue | RS | 6 | Executes the task queue for the primary/standby switchover. The number of threads is specified by the switchover_process_thread_count parameter. Value range: [1, 1000]. |
| LocalityReload | RS | 1 | Regularly refreshes the locality information. |
| RSqlPool | RS | 1 | Allows the standby cluster to regularly maintain the RS_LIST of the primary cluster. |
| ServerTracerTimer | RS | 1 | A timer that uses RPCs to exchange the status of the current server with other servers. |
| LogEngine | CLOG | 1 | Collects and monitors the disk space occupied by clog files and recycles clog files. |
| CLGWR | CLOG | 1 | Writes the clog items to the disk. |
| ClogHisRep | CLOG | 3 | Updates the internal clog history table when a partition goes online or offline. |
| BatchSubmitCtx | CLOG | 1 | Splits the transactions for one-phase commit. |
| LogScanRunnable | CLOG | 4 | Scans all clog files when the OBServer starts. |
| LogStateDri | CLOG | 1 | Switches the primary and secondary replicas of the CLog module and checks the replica cascading status. |
| ObElectionGCThread | election | 1 | Recycles the memory for the election objects. |
| Blocklist | CLOG | 1 | Detects network connection with the destination server. |
| BRPC | CLOG | 5 | Sends the aggregated batch_rpc packages in the background. |
| CLOGReqMinor | CLOG | 1 | Triggers minor compaction tasks based on the clog disk usage and speeds up the recycling of clog files. |
| LineCache | CLOG | 1 | Optimizes the synchronization of historical data. This thread works with liboblog. |
| EXTLogWash | CLOG | 1 | Frequency: 100 ms. |
| CLogFileGC | CLOG | 1 | Regularly recycles clog files. |
| CKPTLogRep | CLOG | 1 | Performs operations on checkpoints of log replicas. |
| RebuildRetry | CLOG | 1 | Retries the partition rebuilding task. |
| ReplayEngine | CLOG | Physical core | Replays the clog files on the follower. |
| PxPoolTh | SQL | 0 | The thread pool for parallel execution. The number of threads is specified by the system variable parallel_max_servers. Default value: 0. |
| sql_mem_timer | SQL | 1 | Supports the automatic memory management. |
| OmtNodeBalancer | common | 1 | Refreshes multi-tenant information in the background. |
| MultiTenant | common | 1 | Refreshes CPU utilization for multiple tenants to schedule resources. |
| SignalHandle | common | 1 | Processes signals. |
| LeaseUpdate | common | 3 | Monitors the lease between the RootServer and each OBServer. |
| RsDDL | common | 1 | Executes the DDL operations of the RootServer. |
| MysqlIO | common | 12 | Manages the connection with MySQL. |
| all_meta_table | common | 8 | Reports the status of a partition or partition group (PG). |
| all_pg_partition_ meta_table | common | 8 | Reports the status of partitions in a PG. |
| TimerMonitor | common | 1 | Monitors the actions of internal scheduled threads and triggers alerts for exceptions in the execution time. |
| ConfigMgr | common | 1 | Refreshes parameters. |
| OB_ALOG | common | 1 | Writes asynchronous system logs to the disk. |
| ELE_ALOG | election | 1 | Writes asynchronous election module logs to the disk. |