Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support the arbitration service feature.
When using the tenant-level arbitration service, you need to configure the log stream downgrade control time. When log synchronization fails due to the failure of half of the F replicas and the log stream downgrade control time is reached, the arbitration service automatically executes the log stream downgrade process to restore service. The default control time for automatic log stream downgrade is 5 seconds, which also represents the service interruption time in case of a data center failure.
Procedure
Log in to the database as the tenant administrator of the
systenant or a user tenant.The following is an example connection string. Please use the actual environment information when connecting to the database.
obclient -h10.xx.xx.xx -P2883 -uroot@sys#obdemo -p***** -AFor more detailed instructions on how to connect to the database, see Overview of database connections (MySQL-compatible mode) and Overview of database connections (Oracle-compatible mode).
View the log stream downgrade control time for the tenant's arbitration service.
Query from the sys tenant for a specified tenant
SHOW PARAMETERS LIKE 'arbitration_timeout' TENANT = 'tenant_name';The following example queries the log stream downgrade control time for the arbitration service of the
mysqltenant:obclient> SHOW PARAMETERS LIKE 'arbitration_timeout' TENANT = 'mysql';Query from a user tenant for itself
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: [1s,+∞]. Values from [1s,3s) are not recommended for non-POC scenarios | TRANS | TENANT | DEFAULT | DYNAMIC_EFFECTIVE | 5s | 1 | +-------+----------+----------------+----------+---------------------+-----------+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------+---------+--------+---------+-------------------+---------------+-----------+ 1 row in setSelect the appropriate statement to modify the log stream downgrade control time based on your usage scenario.
The tenant-level parameter
arbitration_timeoutsets the control time that triggers automatic log stream downgrade. Its default value is 5 seconds, with a range of [1s, +∞). However, it is recommended that the production environment value be no less than 3 seconds, and values within the [1s, 3s) range are only suggested for non-production environments. If you do not want a downgrade to occur, you can set a sufficiently large value, such as 30d (30 days). This parameter takes effect immediately after configuration and does not require restarting the OBServer node.A user tenant modifies its own log stream downgrade control time
obclient> ALTER SYSTEM SET arbitration_timeout = '10s';The
systenant modifies the log stream downgrade control time for a specified tenantobclient> ALTER SYSTEM SET arbitration_timeout = '10s' TENANT = 'tenant_name';systenant modifies the log stream downgrade control time for all user tenants (excluding thesystenant and Meta tenant).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_userhas the same semantics asTENANT = all. When the scope needs to apply to all user tenants, it is recommended to useTENANT = all_user. The latterTENANT = allwill be deprecated in future versions.
References
For more information about the arbitration service, see the following topics: