Modify the log stream downgrade control time

2025-03-26 07:47:21  Updated

Applicability

This topic applies only to OCP Enterprise Edition. OCP Community Edition does not support this feature.

When you enable the arbitration service for a tenant, you must specify 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

  1. Log in to the database as an administrator of the sys tenant or a user tenant.

    Note that you must specify the corresponding parameters in the following sample code based on your actual database configurations.

    obclient -hxx.xx.xx.xx -P2883 -uroot@sys#obdemo -p***** -A
    

    For more information about how to connect to a database, see Overview (MySQL mode) or Overview (Oracle mode).

  2. Query the log stream downgrade control time of the arbitration service for a tenant.

    • Execute the following statement in the sys tenant to query the log stream downgrade control time for the specified tenant:

      SHOW PARAMETERS LIKE 'arbitration_timeout' TENANT = 'tenant_name';
      

      Here is an example:

      obclient> SHOW PARAMETERS LIKE 'arbitration_timeout' TENANT = 'mysql';
      
    • Execute the following statement in a user tenant to query the log stream downgrade control time for the user 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 set
    
  3. Select an appropriate statement to modify the log stream downgrade control time based on your business scenario.

    The arbitration_timeout parameter specifies the control time for triggering automatic downgrade of a log stream for a tenant. The default value is 5s. The value range is [3s,+∞). If you want to avoid the downgrade, you can specify a larger value, for example, 30d. The modification of this parameter takes effect immediately without restarting the OBServer node.

    • Execute the following statement in a user tenant to modify the log stream downgrade control time for the user tenant:

      obclient> ALTER SYSTEM SET arbitration_timeout = '10s';
      
    • Execute the following statement in the sys tenant to modify the log stream downgrade control time for the specified tenant:

      obclient> ALTER SYSTEM SET arbitration_timeout = '10s' TENANT = 'tenant_name';
      
    • Execute the following statement in the sys tenant to modify the log stream downgrade control time for all user tenants:

      obclient> ALTER SYSTEM SET arbitration_timeout = '10s' TENANT = all_user;
      

      or

      obclient> ALTER SYSTEM SET arbitration_timeout = '10s' TENANT = all;
      

      Note

      In OceanBase Database V4.2.1 and later, TENANT = all_user and TENANT = all express the same semantics. If you want an operation to take effect on all user tenants, we recommend that you use TENANT = all_user. TENANT = all will be deprecated.

Contact Us