After you enable the arbitration service for a tenant, you can query views for information about the upgrade or downgrade of log streams in the tenant.
Query log stream upgrade/downgrade events
You can query the DBA_OB_SERVER_EVENT_HISTORY view in the sys tenant for the upgrade and downgrade events of all log streams.
Log on to the
systenant of the cluster as therootuser.Execute the following statements to query whether log stream upgrade or downgrade events have occurred.
Query log stream downgrade events
SELECT * FROM oceanbase.DBA_OB_SERVER_EVENT_HISTORY WHERE event LIKE "%DEGRADE%";If the query result is empty, no log stream is downgraded. Otherwise, the query result shows the information about log stream replicas that have downgraded and the reasons for the degradation.
Reasons for the degradation are as follows:
SERVER_STOPPED_OR_ZONE_STOPPED: Indicates that an OBServer node has crashed or lost network connection. Or, the observer process was killed, or exited unexpectedly.LOG_DISK_HANG_OR_FULL: Indicates that the log disk is stuck in writing (physical failure) or the tenant log disk space is full.SERVER_STOPPED_OR_ZONE_STOPPED: Indicates that theSTOP ZONEorSTOP SERVERcommand was executed.LOG_SYNC_DISABLED: Indicates that the replica log synchronization is lagging behind.LOG_VOTE_DISABLED: Indicates that a rebuild operation was performed on the replica.
Query log stream upgrade events
SELECT * FROM oceanbase.DBA_OB_SERVER_EVENT_HISTORY WHERE event LIKE "%UPGRADE%";If the query result is empty, no log stream is upgraded. Otherwise, the query result shows the information about log stream replicas that have upgraded.
Query the log stream upgrade/downgrade result
After a log stream upgrade or downgrade event occurs, you can query the GV$OB_LOG_STAT view in the sys tenant or the V$OB_LOG_STAT view in a user tenant for the upgrade or downgrade result of the log stream.
Log on to the
systenant or a user tenant as the administrator.Execute the following statement to query the log stream upgrade or downgrade result.
systenantSELECT * FROM oceanbase.GV$OB_LOG_STAT WHERE tenant_id= xxxx;User tenant
MySQL modeOracle modeThe syntax is as follows:
SELECT * FROM oceanbase.GV$OB_LOG_STAT WHERE tenant_id= xxxx;The syntax is as follows:
SELECT * FROM SYS.GV$OB_LOG_STAT WHERE tenant_id= xxxx;
In the query result, view the
DEGRADED_LISTcolumn corresponding to the log stream replica whose role isLEADER. If a log stream downgrade event occurs, the log stream replica downgraded due to an exception is displayed in this column. If a log stream upgrade event occurs, the upgraded replica is removed from this column.
References
For more information about log stream upgrade and downgrade, see the following topics: