From 0f3a235dd20d87ca827914f0704e1237539f0f50 Mon Sep 17 00:00:00 2001 From: yeoncheol-kim Date: Thu, 17 Apr 2025 10:02:57 +0900 Subject: [PATCH] INTERNAL: Change some errors to INVALID --- docs/ascii-protocol/ch04-command-key-value.md | 2 + .../ch05-command-list-collection.md | 1 + .../ch06-command-set-collection.md | 3 +- .../ch07-command-map-collection.md | 2 +- .../ch08-command-btree-collection.md | 8 +- .../ch12-command-administration.md | 2 +- memcached.c | 76 +++++++++---------- t/coll_bop_incrdecr.t | 6 +- t/coll_bop_mget_2.t | 12 +-- t/flush-prefix.t | 2 +- t/incrdecr.t | 2 +- t/nested_prefix.t | 4 +- 12 files changed, 63 insertions(+), 57 deletions(-) diff --git a/docs/ascii-protocol/ch04-command-key-value.md b/docs/ascii-protocol/ch04-command-key-value.md index 33fb3d307..3c67582c6 100644 --- a/docs/ascii-protocol/ch04-command-key-value.md +++ b/docs/ascii-protocol/ch04-command-key-value.md @@ -26,6 +26,7 @@ Response string과 그 의미는 아래와 같다. | "TYPE_MISMATCH" | 해당 아이템이 key-value 타입이 아님. | "CLIENT_ERROR" | 클라이언트에서 잘못된 질의를 했음을 의미. 이어 나오는 문자열을 통해 오류의 원인을 파악 가능. 예) bad command line format | "SERVER_ERROR" | 서버 측의 오류로 저장하지 못했음을 의미. 이어 나오는 문자열을 통해 오류의 원인을 파악 가능. 예) out of memory +| "INVALID" | 정의된 제약 조건을 벗어나 무효 처리되었음을 의미. 이어 나오는 문자열을 통해 오류의 원인을 파악 가능. 예) bad prefix name ## retrieval 명령 @@ -70,6 +71,7 @@ END\r\n |----------------------|------------------------ | | "CLIENT_ERROR" | 클라이언트에서 잘못된 질의를 했음을 의미. 이어 나오는 문자열을 통해 오류의 원인을 파악 가능. 예) bad command line format | "SERVER_ERROR" | 서버 측의 오류로 조회하지 못했음을 의미. 이어 나오는 문자열을 통해 오류의 원인을 파악 가능. 예) out of memory writing get response +| "INVALID" | 정의된 제약 조건을 벗어나 무효 처리되었음을 의미. 이어 나오는 문자열을 통해 오류의 원인을 파악 가능. 예) bad argument mget 명령에서 메모리 부족으로 일부 key에 대해서만 정상 조회한 후 실패한 경우, 전체 연산을 서버 에러 처리한다. diff --git a/docs/ascii-protocol/ch05-command-list-collection.md b/docs/ascii-protocol/ch05-command-list-collection.md index 6d5d3b765..a8834d1c2 100644 --- a/docs/ascii-protocol/ch05-command-list-collection.md +++ b/docs/ascii-protocol/ch05-command-list-collection.md @@ -72,6 +72,7 @@ Response string과 그 의미는 아래와 같다. | "CLIENT_ERROR bad command line format" | protocol syntax 틀림 | "CLIENT_ERROR too large value" | 삽입할 데이터가 element value의 최대 크기보다 큼 | "CLIENT_ERROR bad data chunk" | 삽입할 데이터 길이가 \와 다르거나 "\r\n"으로 끝나지 않음 +| "INVALID bad prefix name" | 유효하지(존재하지) 않는 prefix 명 | "SERVER_ERROR out of memory" | 메모리 부족 ## lop delete diff --git a/docs/ascii-protocol/ch06-command-set-collection.md b/docs/ascii-protocol/ch06-command-set-collection.md index 0b3809d9d..a75bb439d 100644 --- a/docs/ascii-protocol/ch06-command-set-collection.md +++ b/docs/ascii-protocol/ch06-command-set-collection.md @@ -69,6 +69,7 @@ Response string과 그 의미는 아래와 같다. | "CLIENT_ERROR bad command line format" | protocol syntax 틀림 | "CLIENT_ERROR too large value" | 삽입할 데이터가 element value의 최대 크기보다 큼 | "CLIENT_ERROR bad data chunk" | 삽입할 데이터 길이가 \와 다르거나 "\r\n"으로 끝나지 않음 +| "INVALID bad prefix name" | 유효하지(존재하지) 않는 prefix 명 | "SERVER_ERROR out of memory" | 메모리 부족 ## sop delete @@ -141,7 +142,7 @@ END|DELETED|DELETED_DROPPED\r\n | "TYPE_MISMATCH" | 해당 item이 set collection이 아님 | "UNREADABLE" | 해당 item이 unreadable item임 | "NOT_SUPPORTED" | 지원하지 않음 -| "DENIED too many count" | count 제약 개수를 초과함 +| "INVALID too many count" | count 제약 개수를 초과함 | "CLIENT_ERROR bad command line format" | protocol syntax 틀림 | "SERVER_ERROR out of memory [writing get response]" | 메모리 부족 diff --git a/docs/ascii-protocol/ch07-command-map-collection.md b/docs/ascii-protocol/ch07-command-map-collection.md index 3962396fb..d772aa640 100644 --- a/docs/ascii-protocol/ch07-command-map-collection.md +++ b/docs/ascii-protocol/ch07-command-map-collection.md @@ -75,7 +75,7 @@ Response string과 그 의미는 아래와 같다. | "CLIENT_ERROR bad command line format" | protocol syntax 틀림 | "CLIENT_ERROR too large value" | 삽입할 데이터가 element value의 최대 크기보다 큼 | "CLIENT_ERROR bad data chunk" | 삽입할 데이터 길이가 \와 다르거나 "\r\n"으로 끝나지 않음 -| "CLIENT_ERROR invalid prefix name" | 유효하지(존재하지) 않는 prefix 명 +| "INVALID bad prefix name" | 유효하지(존재하지) 않는 prefix 명 | "SERVER_ERROR out of memory" | 메모리 부족 ## mop update diff --git a/docs/ascii-protocol/ch08-command-btree-collection.md b/docs/ascii-protocol/ch08-command-btree-collection.md index 296055dce..be0af21de 100644 --- a/docs/ascii-protocol/ch08-command-btree-collection.md +++ b/docs/ascii-protocol/ch08-command-btree-collection.md @@ -312,7 +312,7 @@ Increment/decrement 수행 후의 데이터 값이다. | "OUT_OF_RANGE" | 새로운 element 삽입이 maxcount 또는 maxbkeyrange 제약을 위배하면서 그 element의 bkey 값이 overflowaction에 의해 자동 삭제되는 경우이어서 삽입이 실패하는 경우이다. 예를 들어, smallest_trim 상황에서 새로 삽입할 element의 bkey 값이 b+tree의 smallest bkey 보다 작으면서 maxcount 개의 elements가 이미 존재하거나 maxbkeyrange를 벗어나는 경우가 이에 해당된다. | "OVERFLOWED" | overflow 발생 | "NOT_SUPPORTED" | 지원하지 않음 -| "CLIENT_ERROR cannot increment or decrement non-numeric value" | 해당 element의 데이터가 숫자형이 아님. +| "INVALID incr or decr on non-numeric value" | 해당 element의 데이터가 숫자형이 아님. | "CLIENT_ERROR bad command line format" | protocol syntax 틀림 | "SERVER_ERROR out of memory [writing get response]" | 메모리 부족 @@ -386,7 +386,7 @@ flags와 ecount를 포함하여 조회된 element 정보가 생략된다. | "NOT_SUPPORTED" | 지원하지 않음 | "CLIENT_ERROR bad command line format" | protocol syntax 틀림 | "CLIENT_ERROR bad data chunk" | space separated key list의 길이가 \와 다르거나 "\r\n"으로 끝나지 않음 -| "CLIENT_ERROR bad value" | bop mget 명령의 제약 조건을 위배함. +| "INVALID bad argument" | bop mget 명령의 제약 조건을 위배함. | "SERVER_ERROR out of memory [writing get response]" | 메모리 부족 ## bop smget @@ -481,7 +481,8 @@ smget 수행의 실패 시의 response string은 다음과 같다. | "NOT_SUPPORTED" | 지원하지 않음 | "CLIENT_ERROR bad command line format" | protocol syntax 틀림 | "CLIENT_ERROR bad data chunk" | 주어진 key 리스트에 중복 key가 존재하거나 주어진 key 리스트의 길이가 \ 길이와 다르거나 "\r\n"으로 끝나지 않음. -| "CLIENT_ERROR bad value" | 앞서 기술한 smget 연산의 제약 조건을 위배 +| "INVALID bad prefix name" | 유효하지(존재하지) 않는 prefix 명 +| "INVALID bad argument" | 앞서 기술한 smget 연산의 제약 조건을 위배 | "SERVER_ERROR out of memory [writing get response]" | 메모리 부족 @@ -609,3 +610,4 @@ END\r\n | "NOT_SUPPORTED" | 지원하지 않음 | "CLIENT_ERROR bad command line format" | protocol syntax 틀림 | "SERVER_ERROR out of memory [writing get response]" | 메모리 부족 +| "INVALID too large count" | count 제약 개수를 초과함 diff --git a/docs/ascii-protocol/ch12-command-administration.md b/docs/ascii-protocol/ch12-command-administration.md index 94a98c401..cb1ac7c74 100644 --- a/docs/ascii-protocol/ch12-command-administration.md +++ b/docs/ascii-protocol/ch12-command-administration.md @@ -522,7 +522,7 @@ space_shortage_level이 10 이상으로 올라가면, background에서 아이템 | Response String | 설명 | | --------------- | ---- | -| "DENIED too many prefixes" | 조회하려는 prefix 개수가 제한을 초과함 | +| "INVALID too many prefixes" | 조회하려는 prefix 개수가 제한을 초과함 | ``` PREFIX itm 2 kitm 1 litm 1 sitm 0 mitm 0 bitm 0 tsz 144 ktsz 64 ltsz 80 stsz 0 mtsz 0 btsz 0 time 20121105152422 diff --git a/memcached.c b/memcached.c index 65f28a6aa..ed6f2a20d 100644 --- a/memcached.c +++ b/memcached.c @@ -1673,7 +1673,7 @@ static void process_lop_insert_complete(conn *c) if (ret == ENGINE_EBADTYPE) out_string(c, "TYPE_MISMATCH"); else if (ret == ENGINE_EOVERFLOW) out_string(c, "OVERFLOWED"); else if (ret == ENGINE_EINDEXOOR) out_string(c, "OUT_OF_RANGE"); - else if (ret == ENGINE_PREFIX_ENAME) out_string(c, "CLIENT_ERROR invalid prefix name"); + else if (ret == ENGINE_PREFIX_ENAME) out_string(c, "INVALID bad prefix name"); else if (ret == ENGINE_ENOMEM) out_string(c, "SERVER_ERROR out of memory"); else handle_unexpected_errorcode_ascii(c, __func__, ret); } @@ -1720,7 +1720,7 @@ static void process_sop_insert_complete(conn *c) if (ret == ENGINE_EBADTYPE) out_string(c, "TYPE_MISMATCH"); else if (ret == ENGINE_EOVERFLOW) out_string(c, "OVERFLOWED"); else if (ret == ENGINE_ELEM_EEXISTS) out_string(c, "ELEMENT_EXISTS"); - else if (ret == ENGINE_PREFIX_ENAME) out_string(c, "CLIENT_ERROR invalid prefix name"); + else if (ret == ENGINE_PREFIX_ENAME) out_string(c, "INVALID bad prefix name"); else if (ret == ENGINE_ENOMEM) out_string(c, "SERVER_ERROR out of memory"); else handle_unexpected_errorcode_ascii(c, __func__, ret); } @@ -1881,7 +1881,7 @@ static void process_mop_insert_complete(conn *c) if (ret == ENGINE_EBADTYPE) out_string(c, "TYPE_MISMATCH"); else if (ret == ENGINE_EOVERFLOW) out_string(c, "OVERFLOWED"); else if (ret == ENGINE_ELEM_EEXISTS) out_string(c, "ELEMENT_EXISTS"); - else if (ret == ENGINE_PREFIX_ENAME) out_string(c, "CLIENT_ERROR invalid prefix name"); + else if (ret == ENGINE_PREFIX_ENAME) out_string(c, "INVALID bad prefix name"); else if (ret == ENGINE_ENOMEM) out_string(c, "SERVER_ERROR out of memory"); else handle_unexpected_errorcode_ascii(c, __func__, ret); } @@ -2301,7 +2301,7 @@ static void process_bop_insert_complete(conn *c) else if (ret == ENGINE_EOVERFLOW) out_string(c, "OVERFLOWED"); else if (ret == ENGINE_EBKEYOOR) out_string(c, "OUT_OF_RANGE"); else if (ret == ENGINE_ELEM_EEXISTS) out_string(c, "ELEMENT_EXISTS"); - else if (ret == ENGINE_PREFIX_ENAME) out_string(c, "CLIENT_ERROR invalid prefix name"); + else if (ret == ENGINE_PREFIX_ENAME) out_string(c, "INVALID bad prefix name"); else if (ret == ENGINE_ENOMEM) out_string(c, "SERVER_ERROR out of memory"); else handle_unexpected_errorcode_ascii(c, __func__, ret); } @@ -3245,7 +3245,7 @@ static void complete_update_ascii(conn *c) out_string(c, "NOT_STORED"); break; case ENGINE_PREFIX_ENAME: - out_string(c, "CLIENT_ERROR invalid prefix name"); + out_string(c, "INVALID bad prefix name"); break; case ENGINE_ENOMEM: out_string(c, "SERVER_ERROR out of memory"); @@ -7877,7 +7877,7 @@ inline static void process_stats_detail(conn *c, const char *command) } else if (strcmp(command, "dump") == 0) { if (stats_prefix_count() > settings.max_stats_prefixes) { - out_string(c, "DENIED too many prefixes"); + out_string(c, "INVALID too many prefixes"); return; } int len; @@ -8286,7 +8286,7 @@ static void process_stats_command(conn *c, token_t *tokens, const size_t ntokens return; } if (mc_engine.v1->prefix_count(mc_engine.v0, c) > settings.max_stats_prefixes) { - out_string(c, "DENIED too many prefixes"); + out_string(c, "INVALID too many prefixes"); return; } stats = mc_engine.v1->prefix_dump_stats(mc_engine.v0, c, NULL, 0, &len); @@ -8312,14 +8312,14 @@ static void process_stats_command(conn *c, token_t *tokens, const size_t ntokens if ((prefixes == NULL && mc_engine.v1->prefix_count(mc_engine.v0, c) > settings.max_stats_prefixes) || nprefixes > settings.max_stats_prefixes) { - out_string(c, "DENIED too many prefixes"); + out_string(c, "INVALID too many prefixes"); return; } stats = mc_engine.v1->prefix_dump_stats(mc_engine.v0, c, prefixes, nprefixes, &len); } else if (strcmp(tokens[2].value, "operation") == 0) { if ((prefixes == NULL && stats_prefix_count() > settings.max_stats_prefixes) || nprefixes > settings.max_stats_prefixes) { - out_string(c, "DENIED too many prefixes"); + out_string(c, "INVALID too many prefixes"); return; } stats = stats_prefix_dump(prefixes, nprefixes, &len); @@ -8487,7 +8487,7 @@ static inline void process_mget_command(conn *c, token_t *tokens, const size_t n numkeys > ((lenkeys/2) + 1) || lenkeys > ((numkeys*KEY_MAX_LENGTH) + numkeys-1)) { /* ENGINE_EBADVALUE */ - out_string(c, "CLIENT_ERROR bad value"); + out_string(c, "INVALID bad argument"); c->sbytes = lenkeys + 2; c->write_and_go = conn_swallow; return; @@ -8673,9 +8673,9 @@ static void process_arithmetic_command(conn *c, token_t *tokens, const size_t nt STATS_CMD_NOKEY(c, decr); } if (ret == ENGINE_EINVAL) - out_string(c, "CLIENT_ERROR cannot increment or decrement non-numeric value"); + out_string(c, "INVALID incr or decr on non-numeric value"); else if (ret == ENGINE_PREFIX_ENAME) - out_string(c, "CLIENT_ERROR invalid prefix name"); + out_string(c, "INVALID bad prefix name"); else if (ret == ENGINE_ENOMEM) out_string(c, "SERVER_ERROR out of memory"); else if (ret == ENGINE_NOT_STORED) @@ -8865,7 +8865,7 @@ static void process_zkfailstop_command(conn *c, token_t *tokens, const size_t nt else if (strcmp(config, "off") == 0) zkfailstop = false; else { - out_string(c, "CLIENT_ERROR bad value"); + out_string(c, "INVALID bad argument"); return; } arcus_zk_set_failstop(zkfailstop); @@ -8889,7 +8889,7 @@ static void process_hbtimeout_command(conn *c, token_t *tokens, const size_t nto if (arcus_hb_set_timeout((int)hbtimeout) == 0) out_string(c, "END"); else - out_string(c, "CLIENT_ERROR bad value"); + out_string(c, "INVALID bad argument"); } else { print_invalid_command(c, tokens, ntokens); out_string(c, "CLIENT_ERROR bad command line format"); @@ -8909,7 +8909,7 @@ static void process_hbfailstop_command(conn *c, token_t *tokens, const size_t nt if (arcus_hb_set_failstop((int)hbfailstop) == 0) out_string(c, "END"); else - out_string(c, "CLIENT_ERROR bad value"); + out_string(c, "INVALID bad argument"); } else { print_invalid_command(c, tokens, ntokens); out_string(c, "CLIENT_ERROR bad command line format"); @@ -8938,7 +8938,7 @@ static void process_memlimit_command(conn *c, token_t *tokens, const size_t ntok } UNLOCK_SETTING(); if (ret == ENGINE_SUCCESS) out_string(c, "END"); - else if (ret == ENGINE_EBADVALUE) out_string(c, "CLIENT_ERROR bad value"); + else if (ret == ENGINE_EBADVALUE) out_string(c, "INVALID bad argument"); else handle_unexpected_errorcode_ascii(c, __func__, ret); } else { print_invalid_command(c, tokens, ntokens); @@ -8968,7 +8968,7 @@ static void process_stickylimit_command(conn *c, token_t *tokens, const size_t n } UNLOCK_SETTING(); if (ret == ENGINE_SUCCESS) out_string(c, "END"); - else if (ret == ENGINE_EBADVALUE) out_string(c, "CLIENT_ERROR bad value"); + else if (ret == ENGINE_EBADVALUE) out_string(c, "INVALID bad argument"); else handle_unexpected_errorcode_ascii(c, __func__, ret); } else { print_invalid_command(c, tokens, ntokens); @@ -9026,7 +9026,7 @@ static void process_maxcollsize_command(conn *c, token_t *tokens, const size_t n } UNLOCK_SETTING(); if (ret == ENGINE_SUCCESS) out_string(c, "END"); - else if (ret == ENGINE_EBADVALUE) out_string(c, "CLIENT_ERROR bad value"); + else if (ret == ENGINE_EBADVALUE) out_string(c, "INVALID bad argument"); else handle_unexpected_errorcode_ascii(c, __func__, ret); } else { @@ -9056,7 +9056,7 @@ static void process_maxelembytes_command(conn *c, token_t *tokens, const size_t } UNLOCK_SETTING(); if (ret == ENGINE_SUCCESS) out_string(c, "END"); - else if (ret == ENGINE_EBADVALUE) out_string(c, "CLIENT_ERROR bad value"); + else if (ret == ENGINE_EBADVALUE) out_string(c, "INVALID bad argument"); else handle_unexpected_errorcode_ascii(c, __func__, ret); } else { @@ -9084,7 +9084,7 @@ static void process_scrubcount_command(conn *c, token_t *tokens, const size_t nt } UNLOCK_SETTING(); if (ret == ENGINE_SUCCESS) out_string(c, "END"); - else if (ret == ENGINE_EBADVALUE) out_string(c, "CLIENT_ERROR bad value"); + else if (ret == ENGINE_EBADVALUE) out_string(c, "INVALID bad argument"); else handle_unexpected_errorcode_ascii(c, __func__, ret); } else { print_invalid_command(c, tokens, ntokens); @@ -9162,7 +9162,7 @@ static void process_chkpt_interval_pct_snapshot_command(conn *c, token_t *tokens } else if (ntokens == 4 && safe_strtoul(config_val, &chkpt_interval_pct_snapshot)) { ret = mc_engine.v1->set_config(mc_engine.v0, c, config_key, (void*)&chkpt_interval_pct_snapshot); if (ret == ENGINE_SUCCESS) out_string(c, "END"); - else if (ret == ENGINE_EBADVALUE) out_string(c, "CLIENT_ERROR bad value"); + else if (ret == ENGINE_EBADVALUE) out_string(c, "INVALID bad argument"); else handle_unexpected_errorcode_ascii(c, __func__, ret); } else { print_invalid_command(c, tokens, ntokens); @@ -9191,7 +9191,7 @@ static void process_chkpt_interval_min_logsize_command(conn *c, token_t *tokens, } else if (ntokens == 4 && safe_strtoul(config_val, &chkpt_interval_min_logsize)) { ret = mc_engine.v1->set_config(mc_engine.v0, c, config_key, (void*)&chkpt_interval_min_logsize); if (ret == ENGINE_SUCCESS) out_string(c, "END"); - else if (ret == ENGINE_EBADVALUE) out_string(c, "CLIENT_ERROR bad value"); + else if (ret == ENGINE_EBADVALUE) out_string(c, "INVALID bad argument"); else handle_unexpected_errorcode_ascii(c, __func__, ret); } else { print_invalid_command(c, tokens, ntokens); @@ -9223,12 +9223,12 @@ static void process_async_logging_command(conn *c, token_t *tokens, const size_t else if (strcmp(config_val, "off") == 0) new_async_logging = false; else { - out_string(c, "CLIENT_ERROR bad value"); + out_string(c, "INVALID bad argument"); return; } ret = mc_engine.v1->set_config(mc_engine.v0, c, config_key, (void*)&new_async_logging); if (ret == ENGINE_SUCCESS) out_string(c, "END"); - else if (ret == ENGINE_EBADVALUE) out_string(c, "CLIENT_ERROR bad value"); + else if (ret == ENGINE_EBADVALUE) out_string(c, "INVALID bad argument"); else handle_unexpected_errorcode_ascii(c, __func__, ret); } else { print_invalid_command(c, tokens, ntokens); @@ -10399,7 +10399,7 @@ static void process_lop_create(conn *c, char *key, size_t nkey, item_attr *attrp default: STATS_CMD_NOKEY(c, lop_create); if (ret == ENGINE_KEY_EEXISTS) out_string(c, "EXISTS"); - else if (ret == ENGINE_PREFIX_ENAME) out_string(c, "CLIENT_ERROR invalid prefix name"); + else if (ret == ENGINE_PREFIX_ENAME) out_string(c, "INVALID bad prefix name"); else if (ret == ENGINE_ENOMEM) out_string(c, "SERVER_ERROR out of memory"); else handle_unexpected_errorcode_ascii(c, __func__, ret); } @@ -10804,7 +10804,7 @@ static void process_sop_create(conn *c, char *key, size_t nkey, item_attr *attrp default: STATS_CMD_NOKEY(c, sop_create); if (ret == ENGINE_KEY_EEXISTS) out_string(c, "EXISTS"); - else if (ret == ENGINE_PREFIX_ENAME) out_string(c, "CLIENT_ERROR invalid prefix name"); + else if (ret == ENGINE_PREFIX_ENAME) out_string(c, "INVALID bad prefix name"); else if (ret == ENGINE_ENOMEM) out_string(c, "SERVER_ERROR out of memory"); else handle_unexpected_errorcode_ascii(c, __func__, ret); } @@ -10951,7 +10951,7 @@ static void process_sop_command(conn *c, token_t *tokens, const size_t ntokens) return; } if (count > MAX_SOP_GET_COUNT) { - out_string(c, "DENIED too many count"); + out_string(c, "INVALID too large count"); return; } if (ntokens == 6) { @@ -11596,7 +11596,7 @@ static void process_bop_create(conn *c, char *key, size_t nkey, item_attr *attrp default: STATS_CMD_NOKEY(c, bop_create); if (ret == ENGINE_KEY_EEXISTS) out_string(c, "EXISTS"); - else if (ret == ENGINE_PREFIX_ENAME) out_string(c, "CLIENT_ERROR invalid prefix name"); + else if (ret == ENGINE_PREFIX_ENAME) out_string(c, "INVALID bad prefix name"); else if (ret == ENGINE_ENOMEM) out_string(c, "SERVER_ERROR out of memory"); else handle_unexpected_errorcode_ascii(c, __func__, ret); } @@ -11701,7 +11701,7 @@ static void process_bop_arithmetic(conn *c, char *key, size_t nkey, bkey_range * } else { STATS_CMD_NOKEY(c, bop_decr); } - if (ret == ENGINE_EINVAL) out_string(c, "CLIENT_ERROR cannot increment or decrement non-numeric value"); + if (ret == ENGINE_EINVAL) out_string(c, "INVALID incr or decr on non-numeric value"); else if (ret == ENGINE_EBADTYPE) out_string(c, "TYPE_MISMATCH"); else if (ret == ENGINE_EBADBKEY) out_string(c, "BKEY_MISMATCH"); else if (ret == ENGINE_EBKEYOOR) out_string(c, "OUT_OF_RANGE"); @@ -12008,7 +12008,7 @@ static void process_mop_create(conn *c, char *key, size_t nkey, item_attr *attrp default: STATS_CMD_NOKEY(c, mop_create); if (ret == ENGINE_KEY_EEXISTS) out_string(c, "EXISTS"); - else if (ret == ENGINE_PREFIX_ENAME) out_string(c, "CLIENT_ERROR invalid prefix name"); + else if (ret == ENGINE_PREFIX_ENAME) out_string(c, "INVALID bad prefix name"); else if (ret == ENGINE_ENOMEM) out_string(c, "SERVER_ERROR out of memory"); else handle_unexpected_errorcode_ascii(c, __func__, ret); } @@ -12146,7 +12146,7 @@ static void process_mop_command(conn *c, token_t *tokens, const size_t ntokens) lenfields > (UINT_MAX-2) || lenfields > ((numfields*MAX_FIELD_LENG) + numfields-1)) { print_invalid_command(c, tokens, ntokens); - out_string(c, "CLIENT_ERROR bad value"); + out_string(c, "INVALID bad argument"); return; } } @@ -12155,7 +12155,7 @@ static void process_mop_command(conn *c, token_t *tokens, const size_t ntokens) numfields > settings.max_map_size || numfields > ((lenfields/2) + 1)) { print_invalid_command(c, tokens, ntokens); - out_string(c, "CLIENT_ERROR bad value"); + out_string(c, "INVALID bad argument"); return; } } @@ -12212,7 +12212,7 @@ static void process_mop_command(conn *c, token_t *tokens, const size_t ntokens) lenfields > (UINT_MAX-2) || lenfields > ((numfields*MAX_FIELD_LENG) + numfields-1)) { print_invalid_command(c, tokens, ntokens); - out_string(c, "CLIENT_ERROR bad value"); + out_string(c, "INVALID bad argument"); return; } } @@ -12221,7 +12221,7 @@ static void process_mop_command(conn *c, token_t *tokens, const size_t ntokens) numfields > settings.max_map_size || numfields > ((lenfields/2) + 1)) { print_invalid_command(c, tokens, ntokens); - out_string(c, "CLIENT_ERROR bad value"); + out_string(c, "INVALID bad argument"); return; } } @@ -12724,7 +12724,7 @@ static void process_bop_command(conn *c, token_t *tokens, const size_t ntokens) lenkeys > ((numkeys*KEY_MAX_LENGTH) + numkeys-1) || count == 0) { /* ENGINE_EBADVALUE */ - out_string(c, "CLIENT_ERROR bad value"); + out_string(c, "INVALID bad argument"); c->sbytes = lenkeys + 2; c->write_and_go = conn_swallow; return; @@ -12734,7 +12734,7 @@ static void process_bop_command(conn *c, token_t *tokens, const size_t ntokens) if (subcommid == OPERATION_BOP_MGET) { if (numkeys > MAX_BMGET_KEY_COUNT || count > MAX_BMGET_ELM_COUNT) { /* ENGINE_EBADVALUE */ - out_string(c, "CLIENT_ERROR bad value"); + out_string(c, "INVALID bad argument"); c->sbytes = lenkeys; c->write_and_go = conn_swallow; return; @@ -12745,7 +12745,7 @@ static void process_bop_command(conn *c, token_t *tokens, const size_t ntokens) if (subcommid == OPERATION_BOP_SMGET) { if (numkeys > MAX_SMGET_KEY_COUNT || (offset+count) > MAX_SMGET_REQ_COUNT) { /* ENGINE_EBADVALUE */ - out_string(c, "CLIENT_ERROR bad value"); + out_string(c, "INVALID bad argument"); c->sbytes = lenkeys; c->write_and_go = conn_swallow; return; @@ -12818,7 +12818,7 @@ static void process_bop_command(conn *c, token_t *tokens, const size_t ntokens) return; } if (count > 100) { /* max limit on count: 100 */ - out_string(c, "CLIENT_ERROR too large count value"); + out_string(c, "INVALID too large count"); return; } } diff --git a/t/coll_bop_incrdecr.t b/t/coll_bop_incrdecr.t index ecdfb97f1..a56f79c85 100644 --- a/t/coll_bop_incrdecr.t +++ b/t/coll_bop_incrdecr.t @@ -108,7 +108,7 @@ END"; mem_cmd_is($sock, $cmd, "", $rst); $cmd = "bop incr bkey1 0x0050 10"; -$rst = "CLIENT_ERROR cannot increment or decrement non-numeric value"; +$rst = "INVALID incr or decr on non-numeric value"; mem_cmd_is($sock, $cmd, "", $rst, "a + 10 = 0"); $cmd = "bop get bkey1 0x0050"; @@ -230,7 +230,7 @@ mem_cmd_is($sock, $cmd, $val, $rst); $cmd = "bop insert bkey1 0x0140 20"; $val = "18446744073709551616"; $rst = "STORED"; mem_cmd_is($sock, $cmd, $val, $rst); -$rst = "CLIENT_ERROR cannot increment or decrement non-numeric value"; +$rst = "INVALID incr or decr on non-numeric value"; $cmd = "bop incr bkey1 0x0100 1"; mem_cmd_is($sock, $cmd, "", $rst, "incr1 on empty"); $cmd = "bop decr bkey1 0x0100 1"; @@ -252,7 +252,7 @@ mem_cmd_is($sock, $cmd, "", $rst, "decr 1 on 18446744073709551615"); $cmd = "bop decr bkey1 0x0130 1"; $rst = "18446744073709551613"; mem_cmd_is($sock, $cmd, "", $rst, "decr 1 on 18446744073709551614"); -$rst = "CLIENT_ERROR cannot increment or decrement non-numeric value"; +$rst = "INVALID incr or decr on non-numeric value"; $cmd = "bop incr bkey1 0x0140 1"; mem_cmd_is($sock, $cmd, "", $rst, "incr 1 on 18446744073709551616"); $cmd = "bop decr bkey1 0x0140 1"; diff --git a/t/coll_bop_mget_2.t b/t/coll_bop_mget_2.t index 9088cd810..edb54cbe5 100644 --- a/t/coll_bop_mget_2.t +++ b/t/coll_bop_mget_2.t @@ -430,21 +430,21 @@ $cmd = "bop mget 600291 2 0..1000 2"; $key1 = "a"x300145; $key2 = "b"x300145; $val = "$key1 $key2"; -mem_cmd_is($sock, $cmd, $val, "CLIENT_ERROR bad value"); +mem_cmd_is($sock, $cmd, $val, "INVALID bad argument"); $val = "$key1,$key2"; -mem_cmd_is($sock, $cmd, $val, "CLIENT_ERROR bad value"); +mem_cmd_is($sock, $cmd, $val, "INVALID bad argument"); $val = "$key1?$key2"; -mem_cmd_is($sock, $cmd, $val, "CLIENT_ERROR bad value"); +mem_cmd_is($sock, $cmd, $val, "INVALID bad argument"); $cmd = "bop mget 66001 2 0..1000 2"; $key1 = "a"x33000; $key2 = "b"x33000; $val = "$key1 $key2"; -mem_cmd_is($sock, $cmd, $val, "CLIENT_ERROR bad value"); +mem_cmd_is($sock, $cmd, $val, "INVALID bad argument"); $val = "$key1,$key2"; -mem_cmd_is($sock, $cmd, $val, "CLIENT_ERROR bad value"); +mem_cmd_is($sock, $cmd, $val, "INVALID bad argument"); $val = "$key1?$key2"; -mem_cmd_is($sock, $cmd, $val, "CLIENT_ERROR bad value"); +mem_cmd_is($sock, $cmd, $val, "INVALID bad argument"); $cmd = "bop mget 30001 3 0..1000 2"; $key1 = "a"x15000; diff --git a/t/flush-prefix.t b/t/flush-prefix.t index 063686014..2923019f6 100644 --- a/t/flush-prefix.t +++ b/t/flush-prefix.t @@ -23,7 +23,7 @@ sub prefix_limit_test { mem_cmd_is($sock, $cmd, $val, $rst); } - $cmd = "stats detail dump"; $rst = "DENIED too many prefixes"; + $cmd = "stats detail dump"; $rst = "INVALID too many prefixes"; mem_cmd_is($sock, $cmd, "", $rst); for ($size = 0; $size < $big_prefix_size; $size++) { diff --git a/t/incrdecr.t b/t/incrdecr.t index c2f88902d..5ddbe5b96 100644 --- a/t/incrdecr.t +++ b/t/incrdecr.t @@ -83,7 +83,7 @@ mem_cmd_is($sock, $cmd, "", $rst); $cmd = "set text 0 0 2"; $val = "hi"; $rst = "STORED"; mem_cmd_is($sock, $cmd, $val, $rst); -$cmd = "incr text 1"; $rst = "CLIENT_ERROR cannot increment or decrement non-numeric value"; +$cmd = "incr text 1"; $rst = "INVALID incr or decr on non-numeric value"; $msg = "hi - 1 = 0"; mem_cmd_is($sock, $cmd, "", $rst, $msg); diff --git a/t/nested_prefix.t b/t/nested_prefix.t index 17f950a0c..417402fe5 100644 --- a/t/nested_prefix.t +++ b/t/nested_prefix.t @@ -147,11 +147,11 @@ sub sop_insert { # stats nested prefix invalid name test # $cmd = "set -pname:cpname:foo 0 0 6"; $val = "fooval"; -# $rst = "CLIENT_ERROR invalid prefix name"; +# $rst = "INVALID bad prefix name"; # mem_cmd_is($sock, $cmd, $val, $rst); # $cmd = "set pname:-cpname:foo 0 0 6"; $val = "fooval"; -# $rst = "CLIENT_ERROR invalid prefix name"; +# $rst = "INVALID bad prefix name"; # mem_cmd_is($sock, $cmd, $val, $rst); # stats prefix flush test