Note
This variable is available starting with V4.1.0.
Description
ob_max_read_stale_time specifies the maximum delay threshold (in microseconds) for weak-consistency reads.
Applicability
This variable is applicable only to OceanBase Database in MySQL mode.
Privilege requirements
Query variables
Global level
The
systenant and all user tenants can execute theSHOW VARIABLESstatement or query theinformation_schema.GLOBAL_VARIABLESview (MySQL mode) to view the value of a global system variable.Session level
The
systenant and all user tenants can execute theSHOW VARIABLESstatement or query theinformation_schema.SESSION_VARIABLESview (MySQL mode) to view the value of a session system variable.
Modify variables
Global level
The
systenant can directly modify the value of a global system variable.A MySQL user tenant can modify the value of a global system variable only if it has the
SUPERorALTER SYSTEMprivilege.
Session level
The
systenant and all user tenants can directly modify the value of a session system variable.
Attributes
| Attribute | Description |
|---|---|
| Type | Int |
| Default value | -1, indicating that the value is not effective.
NoteStarting from V4.1.0 BP2, the default value is changed from 5000000 to -1. |
| Value range | [-1, 9223372036854775807] us
NoteStarting from V4.1.0 BP2, the value range is changed from [0, 9223372036854775807] us to [-1, 9223372036854775807] us. |
| Scope |
|
| Modifiable | Yes. You can execute the SET statement to modify the value. |
Usage notes
The session-level setting specifies the maximum delay threshold for weak-consistency reads. Data read by weak-consistency read requests in the current session must be within the specified delay threshold. Different sessions can have different delay thresholds.
Examples
Set the maximum delay threshold for weak-consistency reads to 5000000 us.
Session level
obclient> SET ob_max_read_stale_time =5000000;Global level
obclient> SET GLOBAL ob_max_read_stale_time =5000000;
