Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support the arbitration service.
When using the tenant-level arbitration service, you need to configure the log stream downgrade control time. When log synchronization fails due to failures of half of the full-featured replicas and the log stream downgrade control time is reached, the arbitration service automatically performs the log stream downgrade process to recover services. The default log stream downgrade control time is 5s, which indicates the service interruption duration when an IDC fails.
Procedure
Log in to the database as a tenant administrator of the
systenant or a user tenant.Below is a connection example. Use your actual environment when connecting to the database.
obclient -h10.xx.xx.xx -P2883 -uroot@sys#obdemo -p***** -AFor more detailed guidance on connecting to the database, see Overview of connection methods (MySQL-compatible mode) and Overview of connection methods (Oracle-compatible mode).
View the log stream downgrade control time of the arbitration service for a tenant.
The sys tenant queries a specified tenant:
SHOW PARAMETERS LIKE 'arbitration_timeout' TENANT = 'tenant_name';Example for querying the log stream downgrade control time of tenant
mysql:obclient> SHOW PARAMETERS LIKE 'arbitration_timeout' TENANT = 'mysql';The user tenant queries its own tenant:
obclient> SHOW PARAMETERS LIKE 'arbitration_timeout';
The query result is as follows:
+-------+----------+----------------+----------+---------------------+-----------+-------+---------------------------------------------------------------------------------------------+---------+--------+---------+-------------------+---------------+-----------+ | zone | svr_type | svr_ip | svr_port | name | data_type | value | info | section | scope | source | edit_level | default_value | isdefault | +-------+----------+----------------+----------+---------------------+-----------+-------+---------------------------------------------------------------------------------------------+---------+--------+---------+-------------------+---------------+-----------+ | zone1 | observer | 172.xx.xxx.xxx | 2882 | arbitration_timeout | TIME | 5s | The timeout before automatically degrading when arbitration member exists. Range: [3s,+∞] | TRANS | TENANT | DEFAULT | DYNAMIC_EFFECTIVE | 5s | 1 | +-------+----------+----------------+----------+---------------------+-----------+-------+---------------------------------------------------------------------------------------------+---------+--------+---------+-------------------+---------------+-----------+ 1 row in setSelect an appropriate statement to modify the log stream downgrade control time based on your usage scenario.
The tenant-level parameter
arbitration_timeoutspecifies the control time for triggering automatic log stream downgrade. The default value is 5s. The value range is [3s, +∞). If you do not want downgrade to occur, you can set a sufficiently large value, for example,30d(30 days). This parameter takes effect immediately after configuration without restarting the OBServer node.The user tenant modifies its own log stream downgrade control time:
obclient> ALTER SYSTEM SET arbitration_timeout = '10s';The sys tenant modifies the log stream downgrade control time for a specified tenant:
obclient> ALTER SYSTEM SET arbitration_timeout = '10s' TENANT = 'tenant_name';The sys tenant modifies the log stream downgrade control time for all user tenants (excluding the
systenant and Meta tenants):obclient> ALTER SYSTEM SET arbitration_timeout = '10s' TENANT = all_user;or
obclient> ALTER SYSTEM SET arbitration_timeout = '10s' TENANT = all;Note
Starting from OceanBase Database V4.2.1,
TENANT = all_userandTENANT = allhave the same semantics. When you need the scope to be all user tenants, we recommend that you useTENANT = all_user.TENANT = allwill be deprecated and will no longer be used.
References
For more information about the arbitration service, see the following topics: