Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 3.9k
[chore](status) unify error code between thrift,pb, status.h#34397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
fdcfa95
[status](checker) add check for tstatus and status
Doris-Extras ad3704d
f
Doris-Extras 1f78cc3
f
Doris-Extras ac60a08
f
Doris-Extras b2f1710
f
Doris-Extras 5db3657
f
Doris-Extras 47ce3be
f
Doris-Extras 22fbd98
f
Doris-Extras File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -30,58 +30,49 @@ class PStatus; | ||
| namespace ErrorCode { | ||
| // E thrift_error_name, print_stacktrace | ||
| #define APPLY_FOR_THRIFT_ERROR_CODES(TStatusError) \ | ||
| TStatusError(PUBLISH_TIMEOUT, false); \ | ||
| TStatusError(MEM_ALLOC_FAILED, true); \ | ||
| TStatusError(BUFFER_ALLOCATION_FAILED, true); \ | ||
| TStatusError(INVALID_ARGUMENT, false); \ | ||
| TStatusError(INVALID_JSON_PATH, false); \ | ||
| TStatusError(MINIMUM_RESERVATION_UNAVAILABLE, true); \ | ||
| TStatusError(CORRUPTION, true); \ | ||
| TStatusError(IO_ERROR, true); \ | ||
| TStatusError(NOT_FOUND, true); \ | ||
| TStatusError(ALREADY_EXIST, true); \ | ||
| TStatusError(NOT_IMPLEMENTED_ERROR, true); \ | ||
| TStatusError(END_OF_FILE, false); \ | ||
| TStatusError(INTERNAL_ERROR, true); \ | ||
| TStatusError(RUNTIME_ERROR, true); \ | ||
| TStatusError(CANCELLED, false); \ | ||
| TStatusError(MEM_LIMIT_EXCEEDED, false); \ | ||
| TStatusError(THRIFT_RPC_ERROR, true); \ | ||
| TStatusError(TIMEOUT, true); \ | ||
| TStatusError(TOO_MANY_TASKS, true); \ | ||
| TStatusError(UNINITIALIZED, false); \ | ||
| TStatusError(ABORTED, true); \ | ||
| TStatusError(DATA_QUALITY_ERROR, false); \ | ||
| TStatusError(LABEL_ALREADY_EXISTS, true); \ | ||
| TStatusError(NOT_AUTHORIZED, true); \ | ||
| TStatusError(HTTP_ERROR, true); \ | ||
| #define APPLY_FOR_THRIFT_ERROR_CODES(TStatusError) \ | ||
| TStatusError(PUBLISH_TIMEOUT, false); \ | ||
| TStatusError(MEM_ALLOC_FAILED, true); \ | ||
| TStatusError(BUFFER_ALLOCATION_FAILED, true); \ | ||
| TStatusError(INVALID_ARGUMENT, false); \ | ||
| TStatusError(INVALID_JSON_PATH, false); \ | ||
| TStatusError(MINIMUM_RESERVATION_UNAVAILABLE, true); \ | ||
| TStatusError(CORRUPTION, true); \ | ||
| TStatusError(IO_ERROR, true); \ | ||
| TStatusError(NOT_FOUND, true); \ | ||
| TStatusError(ALREADY_EXIST, true); \ | ||
| TStatusError(NOT_IMPLEMENTED_ERROR, true); \ | ||
| TStatusError(END_OF_FILE, false); \ | ||
| TStatusError(INTERNAL_ERROR, true); \ | ||
| TStatusError(RUNTIME_ERROR, true); \ | ||
| TStatusError(CANCELLED, false); \ | ||
| TStatusError(ANALYSIS_ERROR, false); \ | ||
| TStatusError(MEM_LIMIT_EXCEEDED, false); \ | ||
| TStatusError(THRIFT_RPC_ERROR, true); \ | ||
| TStatusError(TIMEOUT, true); \ | ||
| TStatusError(TOO_MANY_TASKS, true); \ | ||
| TStatusError(UNINITIALIZED, false); \ | ||
| TStatusError(INCOMPLETE, false); \ | ||
| TStatusError(OLAP_ERR_VERSION_ALREADY_MERGED, false); \ | ||
| TStatusError(ABORTED, true); \ | ||
| TStatusError(DATA_QUALITY_ERROR, false); \ | ||
| TStatusError(LABEL_ALREADY_EXISTS, true); \ | ||
| TStatusError(NOT_AUTHORIZED, true); \ | ||
| TStatusError(BINLOG_DISABLE, false); \ | ||
| TStatusError(BINLOG_TOO_OLD_COMMIT_SEQ, false); \ | ||
| TStatusError(BINLOG_TOO_NEW_COMMIT_SEQ, false); \ | ||
| TStatusError(BINLOG_NOT_FOUND_DB, false); \ | ||
| TStatusError(BINLOG_NOT_FOUND_TABLE, false); \ | ||
| TStatusError(NETWORK_ERROR, false); \ | ||
| TStatusError(ILLEGAL_STATE, false); \ | ||
| TStatusError(SNAPSHOT_NOT_EXIST, true); \ | ||
| TStatusError(HTTP_ERROR, true); \ | ||
| TStatusError(TABLET_MISSING, true); \ | ||
| TStatusError(NOT_MASTER, true); \ | ||
| TStatusError(DELETE_BITMAP_LOCK_ERROR, false); | ||
| // E error_name, error_code, print_stacktrace | ||
| #define APPLY_FOR_OLAP_ERROR_CODES(E) \ | ||
| E(OK, 0, false); \ | ||
| E(OS_ERROR, -100, true); \ | ||
| E(DIR_NOT_EXIST, -101, true); \ | ||
| E(FILE_NOT_EXIST, -102, true); \ | ||
| E(CREATE_FILE_ERROR, -103, true); \ | ||
| E(STL_ERROR, -105, true); \ | ||
| E(MUTEX_ERROR, -107, true); \ | ||
| E(PTHREAD_ERROR, -108, true); \ | ||
| E(NETWORK_ERROR, -109, true); \ | ||
| E(UB_FUNC_ERROR, -110, true); \ | ||
| E(COMPRESS_ERROR, -111, true); \ | ||
| E(DECOMPRESS_ERROR, -112, true); \ | ||
| E(UNKNOWN_COMPRESSION_TYPE, -113, true); \ | ||
| E(MMAP_ERROR, -114, true); \ | ||
| E(CANNOT_CREATE_DIR, -117, true); \ | ||
| E(UB_NETWORK_ERROR, -118, true); \ | ||
| E(FILE_FORMAT_ERROR, -119, true); \ | ||
| E(EVAL_CONJUNCTS_ERROR, -120, true); \ | ||
| E(COPY_FILE_ERROR, -121, true); \ | ||
| E(FILE_ALREADY_EXIST, -122, true); \ | ||
| E(BAD_CAST, -123, true); \ | ||
| E(ARITHMETIC_OVERFLOW_ERRROR, -124, false); \ | ||
| E(PERMISSION_DENIED, -125, false); \ | ||
| E(CALL_SEQUENCE_ERROR, -202, true); \ | ||
| E(BUFFER_OVERFLOW, -204, true); \ | ||
| E(CONFIG_ERROR, -205, true); \ | ||
| @@ -118,6 +109,20 @@ namespace ErrorCode { | ||
| E(ALREADY_CLOSED, -239, false); \ | ||
| E(SERVICE_UNAVAILABLE, -240, true); \ | ||
| E(NEED_SEND_AGAIN, -241, false); \ | ||
| E(OS_ERROR, -242, true); \ | ||
| E(DIR_NOT_EXIST, -243, true); \ | ||
| E(FILE_NOT_EXIST, -244, true); \ | ||
| E(CREATE_FILE_ERROR, -245, true); \ | ||
| E(STL_ERROR, -246, true); \ | ||
| E(MUTEX_ERROR, -247, true); \ | ||
| E(PTHREAD_ERROR, -248, true); \ | ||
| E(UB_FUNC_ERROR, -250, true); \ | ||
| E(COMPRESS_ERROR, -251, true); \ | ||
| E(DECOMPRESS_ERROR, -252, true); \ | ||
| E(FILE_ALREADY_EXIST, -253, true); \ | ||
| E(BAD_CAST, -254, true); \ | ||
| E(ARITHMETIC_OVERFLOW_ERRROR, -255, false); \ | ||
| E(PERMISSION_DENIED, -256, false); \ | ||
| E(CE_CMD_PARAMS_ERROR, -300, true); \ | ||
| E(CE_BUFFER_TOO_SMALL, -301, true); \ | ||
| E(CE_CMD_NOT_VALID, -302, true); \ | ||
| @@ -301,15 +306,39 @@ extern ErrorCodeState error_states[MAX_ERROR_CODE_DEFINE_NUM]; | ||
| class ErrorCodeInitializer { | ||
| public: | ||
| ErrorCodeInitializer() { | ||
| #define M(NAME, ENABLESTACKTRACE) error_states[TStatusCode::NAME].stacktrace = ENABLESTACKTRACE; | ||
| ErrorCodeInitializer(int temp) : signal_value(temp) { | ||
yiguolei marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| for (int i = 0; i < MAX_ERROR_CODE_DEFINE_NUM; ++i) { | ||
| error_states[i].error_code = 0; | ||
yiguolei marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| } | ||
| #define M(NAME, ENABLESTACKTRACE) \ | ||
| error_states[TStatusCode::NAME].stacktrace = ENABLESTACKTRACE; \ | ||
| error_states[TStatusCode::NAME].description = #NAME; \ | ||
| error_states[TStatusCode::NAME].error_code = TStatusCode::NAME; | ||
| APPLY_FOR_THRIFT_ERROR_CODES(M) | ||
| #undef M | ||
| #define M(NAME, ERRORCODE, ENABLESTACKTRACE) \ | ||
| error_states[abs(ERRORCODE)].stacktrace = ENABLESTACKTRACE; | ||
| // In status.h, if error code > 0, then it means it will be used in TStatusCode and will | ||
| // also be used in FE. | ||
| // Other error codes that with error code < 0, will only be used in BE. | ||
| // We use abs(error code) as the index in error_states, so that these two kinds of error | ||
| // codes MUST not have overlap. | ||
| // Add an assert here to make sure the code in TStatusCode and other error code are not | ||
| // overlapped. | ||
| #define M(NAME, ERRORCODE, ENABLESTACKTRACE) \ | ||
| assert(error_states[abs(ERRORCODE)].error_code == 0); \ | ||
| error_states[abs(ERRORCODE)].stacktrace = ENABLESTACKTRACE; \ | ||
| error_states[abs(ERRORCODE)].error_code = ERRORCODE; | ||
| APPLY_FOR_OLAP_ERROR_CODES(M) | ||
| #undef M | ||
| } | ||
| void check_init() { | ||
| //the signal value is 0, it means the global error states not inited, it's logical error | ||
| // DO NOT use dcheck here, because dcheck depend on glog, and glog maybe not inited at this time. | ||
| assert(signal_value != 0); | ||
| } | ||
| private: | ||
| int signal_value = 0; | ||
| }; | ||
| extern ErrorCodeInitializer error_code_init; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2 regression-test/suites/external_table_p0/hive/ddl/test_hive_write_type.groovy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.