Note
This variable is available starting with V4.1.0.
Overview
ob_max_read_stale_time specifies the maximum latency threshold (in microseconds) for weak-consistency read queries.
Applicability
This variable applies only to the MySQL-compatible mode of OceanBase Database.
Privilege requirements
Query variables
Global level
The
systenant and all user tenants can use theSHOW VARIABLESstatement or theinformation_schema.GLOBAL_VARIABLESview (in MySQL-compatible mode) to view the values of global system variables.Session level
The
systenant and all user tenants can use theSHOW VARIABLESstatement or theinformation_schema.SESSION_VARIABLESview (in MySQL-compatible mode) to view the values of session system variables.
Modify variables
Global effective
The
systenant can directly modify the values of global system variables.MySQL user tenants must have the
SUPERorALTER SYSTEMprivilege to modify the values of global system variables.
Session expiration
The
systenant and all user tenants can directly modify the values of session system variables for their own tenants.
Attributes
Attribute |
Description |
|---|---|
| Parameter type | Int |
| Default Value | -1 indicates that the setting does not take effect.
NoteStarting from V4.1.0 BP2, the default value has been changed from 5000000 to -1. |
| Value range | [-1, 9223372036854775807] us
NoteStarting from V4.1.0 BP2, the value range has been adjusted from [0, 9223372036854775807] us to [-1, 9223372036854775807] us. |
| Effective Scope |
|
| Modifiable | Yes, you can use theSETStatement modification. |
Usage instructions
The session-level weak read latency threshold specifies that the data read by a weak-read request of the current session must be within the set latency threshold. Different sessions can be configured with different latency thresholds.
Configuration example
Set the maximum latency threshold for weak-consistency read queries to 5,000,000 μs.
Session expiration
obclient> SET ob_max_read_stale_time =5000000;Effective globally
obclient> SET GLOBAL ob_max_read_stale_time =5000000;
