List of error codes returned by Tars framework and Dcache

List of error codes returned by Tars framework and Dcache

Introduction


Students who read this article should know Tars and Dcache.

But when using it, sometimes you will encounter a cold number: error code.

Since there is no descriptive information in text, I have to go back to check various documents and even check the source code. This is the author's experience.

After searching, I found the source file that defines the error code and posted it here for easy reference.

The latest definition is based on the official code.

Tars frame error code


The tars error code file is located at:

tarscpp/servant/protocol/servant/BaseF.tars
.

module tars { //Define the version number of the protocol const short TARSVERSION = 0x01 ; const short TUPVERSION = 0x03 ; const short XMLVERSION = 0x04 ; const short JSONVERSION = 0x05 ; //Define the type of message //Ordinary call const byte TARSNORMAL = 0x00 ; //One-way call const byte TARSONEWAY = 0x01 ; //Return code defined by TARS const int TARSSERVERSUCCESS = 0 ; //the server process successfully const int TARSSERVERDECODEERR = - . 1 ; //server abnormal decoding const int TARSSERVERENCODEERR = - 2 ; //server encoding abnormal const int TARSSERVERNOFUNCERR = - . 3 ; //the server does not the function const int TARSSERVERNOSERVANTERR = - . 4 ; //the server object is not the Servant const int TARSSERVERRESETGRID = - . 5 ; //server gray state inconsistency const int TARSSERVERQUEUETIMEOUT = - . 6 ; //server queue exceeds the limit const int TARSASYNCCALLTIMEOUT = - . 7 ; //asynchronous call timeout const int TARSINVOKETIMEOUT = - . 7 ; //call timed const int TARSPROXYCONNECTERR = - . 8 ; //Proxy link abnormality const int TARSSERVEROVERLOAD = - . 9 ; //the server is overloaded, the queue length exceeds const int TARSADAPTERNULL = -10 ; //client routing is empty, the service does not exist or all of the services is down const int TARSINVOKEBYINVALIDESET = - 11 ; //client calls illegal according to the rules set const int TARSCLIENTDECODEERR = - 12 ; //client decoding abnormal const int TARSSERVERUNKNOWNERR = - 99 ; //server abnormal position / //Define the bitwise message status type, which can be compounded const int TARSMESSAGETYPENULL = 0x00 ; //Stateless const int TARSMESSAGETYPEHASH = 0x01 ; //HASH message const int TARSMESSAGETYPEGRID = 0x02 ; //Gray message const int TARSMESSAGETYPEDYED = 0x04 ; //Dyeing message const int TARSMESSAGETYPESAMPLE = 0x08 ; //stat Sampling message const int TARSMESSAGETYPEASYNC = 0x10 ; //call the program asynchronously //const int TARSMESSAGETYPELOADED = 0x20;//call the program according to the load value //const int TARSMESSAGETYPESETED = 0x40;//call the type according to the set rule, this field will not use const int TARSMESSAGETYPESETNAME = 0x80 ; //call the type according to the setname rule const int TARSMESSAGETYPETRACK = 0x100 ; //track call chain message / } ;

Dcache error code


The error description is defined in

DCache/src/TarsComm/ProxyShare.tars
.

// Proxy return value definition const int ET_SUCC = 0 ; const int ET_SYS_ERR = - . 1 ; const int ET_MODULE_NAME_INVALID = - 2 ; const int ET_KEY_INVALID = - . 3 ; const int ET_KEY_AREA_ERR = - . 4 ; const int ET_KEY_TYPE_ERR = - . 5 ; const int ET_NO_DATA = - . 6 ; constint ET_COMMAND_INVALID = //When used to synchronize data between nodes, it means that the synchronization set is equal to the local set const - 31 ; -7; const int ET_FORBID_DEL = -8; const int ET_SERVER_TYPE_ERR = -9; const int ET_DATA_EXIST = -10; const int ET_FORBID_OPT = -11; const int ET_INPUT_PARAM_ERROR = -12; const int ET_ONLY_KEY = -13; const int ET_DIRTY_DATA = - 14 ; const int ET_DATA_VER_MISMATCH = - 15 ; const int ET_PARTIAL_FAIL = - 16 ; //the two batches used to insert the data, a partial data set failed const int ET_GZIP_UNCOMPRESS_ERR = - . 17 ; //for data compression when decompression fails const int ET_CACHE_TYPE_ERR = - 18 is ; //the synchronization data between the nodes for indicating the type of cache errors const int ET_SYNC_SET_SAME = - . 19 ; int ET_SET_SYNC_NOENABLE = - 20 is ; //the data for synchronization between nodes, inter-node data indicating that the Proxy does not support simultaneous const int ET_MEM_FULL = - 21 is ; //cache memory is full const int ET_DATA_TOO_MUCH = - 22 is ; //data exceeds 2w article const int ET_READ_ONLY = - 23 is ; //read-only Cache, typically generated during the switchover const int ET_DB_ERR = - 24 ; //DB access Exception const int ET_CACHE_ERR = - 25 ; //cache access exception const int ET_PARAM_REDUNDANT = - 26 is ; //duplicate field or an invalid field const int ET_PARAM_MISSING = - 27 ; //field is missing const int ET_PARAM_TOO_LONG = - 28 ; //long field const int ET_PARAM_DIGITAL_ERR = - 29 ; //number field parameter error const int ET_PARAM_NOT_EXIST = - 30 ; //field does not exist, invalid field const int ET_PARAM_OP_ERR = //op错误 const int ET_PARAM_UKEY_MISSING = -32; //联合key字段缺失 const int ET_PARAM_UPDATE_UKEY_ERR = -33; //不允许更新联合key const int ET_PARAM_LIMIT_VALUE_ERR = -34; //limit条件参数错误 const int ET_ERASE_DIRTY_ERR = -35; //不允许擦除脏数据 const int ET_DB_TO_CACHE_ERR = -36; //写DB返回数据到cache失败 const string DVER = "@DataVer" ; const string EXPIRETIME = "@ExpireTime" ; const string SCOREVALUE = "@ScoreValue" ; //KV batch query ret field definition const int VALUE_SUCC = 0 ; const int VALUE_NO_DATA = 1 ; //KV ret batch write field are defined const int SET_SUCC = 0 ; //SET successful const int SET_ERROR = - . 1 ; //SET failure const int SET_DATA_VER_MISMATCH = - 2 ; //SET failure, particularly because of the wrong version of the data //KV, MKV bulk erase, del define the return value of the field const int DEL_SUCC = 0 ; //delete success const int DEL_ERROR = - 1 ; //delete failed const int DEL_DATA_VER_MISMATCH = - 2 ; //delete failed, specific reasons Data version error //KV, MKV bulk field when writing the return value is defined const int WRITE_SUCC = 0 ; //write succeeds const int WRITE_ERROR = - . 1 ; //write failure const int WRITEL_DATA_VER_MISMATCH = - 2 ; //write failure, particularly because the data Wrong version

summary


According to the author's experience, Tars errors are mostly timeout errors (-6, -7), and Dcache errors are mostly -3, -28, etc.

With this error description, it is convenient for everyone to find and locate the bug.


Reference : https://blog.csdn.net/guotianqing/article/details/108983888