Automatic Retry upon SQL Statement Execution Errors
With automatic retry (referred to as CN retry), DWS retries an SQL statement when the execution of a statement fails. If an SQL statement sent from the gsql client, JDBC driver, or ODBC driver fails to be executed, the CN can automatically identify the error reported during execution and re-deliver the task to retry.
Constraints on CN Retry
|
Constraint |
Description |
|---|---|
|
Function scope |
|
|
Error type |
Only the error types in Table 2 are supported. |
|
Statement type |
Single-statement CN retry, stored procedures, functions, and anonymous blocks are supported. Statements in transaction blocks are not supported. |
|
Stored procedure statement |
|
|
Cluster status |
|
|
Data import |
|
Error Types Supported by CN Retry
Table 2 lists the error types supported by CN retry and the corresponding error codes. You can use the GUC parameter retry_ecode_list to set the list of error types supported by CN retry. You are not advised to modify this parameter. To modify it, contact technical support.
|
Error Type |
Error Code |
Remarks |
|---|---|---|
|
CONNECTION_RESET_BY_PEER |
YY001 |
TCP communication errors: Connection reset by peer (communication between the CN and DNs) |
|
STREAM_CONNECTION_RESET_BY_PEER |
YY002 |
TCP communication errors: Stream connection reset by peer (communication between DNs) |
|
LOCK_WAIT_TIMEOUT |
YY003 |
Lock wait timeout |
|
CONNECTION_TIMED_OUT |
YY004 |
TCP communication errors: Connection timed out |
|
SET_QUERY_ERROR |
YY005 |
Failed to deliver the SET command: Set query |
|
OUT_OF_LOGICAL_MEMORY |
YY006 |
Failed to apply for memory: Out of logical memory |
|
SCTP_MEMORY_ALLOC |
YY007 |
SCTP communication errors: Memory allocate error |
|
SCTP_NO_DATA_IN_BUFFER |
YY008 |
SCTP communication errors: SCTP no data in buffer |
|
SCTP_RELEASE_MEMORY_CLOSE |
YY009 |
SCTP communication errors: Release memory close |
|
SCTP_TCP_DISCONNECT |
YY010 |
SCTP communication errors: TCP disconnect |
|
SCTP_DISCONNECT |
YY011 |
SCTP communication errors: SCTP disconnect |
|
SCTP_REMOTE_CLOSE |
YY012 |
SCTP communication errors: Stream closed by remote |
|
SCTP_WAIT_POLL_UNKNOWN |
YY013 |
Waiting for an unknown poll: SCTP wait poll unknown |
|
SNAPSHOT_INVALID |
YY014 |
Snapshot invalid |
|
ERRCODE_CONNECTION_RECEIVE_WRONG |
YY015 |
Connection receive wrong |
|
OUT_OF_MEMORY |
53200 |
Out of memory |
|
CONNECTION_FAILURE |
08006 |
GTM errors: Connection failure |
|
CONNECTION_EXCEPTION |
08000 |
Failed to communicate with DNs due to connection errors: Connection exception |
|
ADMIN_SHUTDOWN |
57P01 |
System shutdown by administrators: Admin shutdown |
|
STREAM_REMOTE_CLOSE_SOCKET |
XX003 |
Remote socket disabled: Stream remote close socket |
|
ERRCODE_STREAM_DUPLICATE_QUERY_ID |
XX009 |
Duplicate query id |
|
ERRCODE_STREAM_CONCURRENT_UPDATE |
YY016 |
Stream concurrent update |
|
ERRCODE_LLVM_BAD_ALLOC_ERROR |
CG003 |
Memory allocation error: Allocate error |
|
ERRCODE_LLVM_FATAL_ERROR |
CG004 |
Fatal error |
|
HashJoin temporary file reading error (ERRCODE_HASHJOIN_TEMP_FILE_ERROR). |
F0011 |
File error |
|
Buffer file reading error (ERRCODE_BUFFER_FILE_ERROR) |
F0012 |
File reading error |
|
Partition number error (ERRCODE_PARTITION_NUM_CHANGED). |
45003 |
During scanning on a list partition table, it is found that the number of partitions is different from that in the optimization phase. This problem usually occurs when the queries and ADD/DROP partitions are concurrently executed. (This error is supported only by clusters of version 8.1.3 or later.) |
|
Unmatched schema name (ERRCODE_UNMATCH_OBJECT_SCHEMA) |
42P30 |
Unmatched schema name |
Enabling CN Retry
- Mandatory GUC parameters (need to be set on both CNs and DNs)
max_query_retry_times: specifies the maximum number of automatic retry times when an SQL statement error occurs. Currently, a statement can start retrying if the following errors occur: Connection reset by peer, Lock wait timeout, and Connection timed out. The default value is 6.
If CN retry is enabled, temporary table data is logged. For data consistency, do not switch the enabled/disabled status for CN retry when the temporary tables are being used by sessions.
- Optional GUC parameters (contact technical support to modify them)
- cn_send_buffer_size: specifies the size of the data buffer used for data transmission on the CN. The default value is 8 KB.
- max_cn_temp_file_size: specifies the maximum size of temporary files used on the CN when SQL statements are automatically retried. The default value is 5 GB.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot