There are two types of tenant roles in the OceanBase cluster: primary and standby. Tenants created under normal circumstances are primary tenants, while tenants created using the physical standby database feature are standby tenants.
Tenant roles can be dynamically changed through switchover and failover operations.
Switchover
Switchover operation changes tenant roles as per user planning. After executing the switchover operation, the primary tenant will exchange roles with the corresponding standby tenant. Throughout this process, data loss is prevented (RPO = 0), and execution time generally ranges in seconds.
Failover
Failover operation is usually performed when the primary tenant experiences an unrecoverable fault. After executing the failover operation, the corresponding standby tenant's role changes to primary. Simultaneously, if the standby tenant, which was synchronizing normally before the failure of the primary tenant, performs the failover operation, there might be data loss generally in the range of hundreds of milliseconds, with execution time typically in seconds.