After you enable the arbitration service for a tenant, you can query log stream upgrade or downgrade information through views.
Query log stream upgrade/downgrade events
The sys tenant can query the DBA_OB_SERVER_EVENT_HISTORY view for upgrade or downgrade events of all log streams.
Log in 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 downgrade event has occurred. Otherwise, the query result shows the replica information of downgraded log streams and the reasons for the downgrade.
Reasons for the downgrade include:
CRASHED_OR_BROKEN_NETWORK: Indicates that an OBServer node is down or disconnected, or the observer process was killed or exited abnormally.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 upgrade event has occurred. Otherwise, the query result shows the replica information of upgraded log streams.
Query the log stream upgrade and downgrade result
After a log stream upgrade or downgrade event occurs, the sys tenant or a user tenant can query the GV$OB_LOG_STAT or V$OB_LOG_STAT view for the upgrade or downgrade result of the log stream.
Log in to the
systenant or a user tenant as a tenant administrator.Execute the following statement to view the log stream upgrade or downgrade result.
systenantSELECT * FROM oceanbase.GV$OB_LOG_STAT WHERE tenant_id= xxxx;User tenant
MySQL-compatible modeOracle-compatible 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: