Skip to content

Commit cebf4c4

Browse files
committed
INTERNAL: Extend bkey/eflag max length
1 parent c3340cb commit cebf4c4

File tree

7 files changed

+17
-18
lines changed

7 files changed

+17
-18
lines changed

docs/ascii-protocol/ch03-item-attributes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ ARCUS Cache Server는 collection 기능 지원으로 인해,
3434
| readable | collection | readable/unreadable | "on", "off" | "on" |
3535
|-----------------------------------------------------------------------------------------------------------------|
3636
| maxbkeyrange | b+tree only | maximum bkey range | 8 bytes unsigned integer or | 0 |
37-
| | | | hexadecimal (max 31 bytes) | |
37+
| | | | hexadecimal (max 63 bytes) | |
3838
|-----------------------------------------------------------------------------------------------------------------|
3939
```
4040

include/memcached/types.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,8 @@ extern "C" {
288288
* bkey and eflag
289289
*/
290290
#define MIN_BKEY_LENG 1
291-
#define MAX_BKEY_LENG 31
292-
#define MAX_EFLAG_LENG 31
291+
#define MAX_BKEY_LENG 63
292+
#define MAX_EFLAG_LENG 63
293293
#define MAX_FIELD_LENG 250
294294
#define BKEY_NULL 255
295295
#define EFLAG_NULL 255

memcached.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13272,10 +13272,9 @@ static int try_read_command_ascii(conn *c)
1327213272
}
1327313273
/* Check KEY_MAX_LENGTH and eflag filter length
1327413274
* - KEY_MAX_LENGTH : 16000
13275-
* - IN eflag filter : > 6400 (64*100)
13275+
* - IN eflag filter : > 12800 (128*100)
1327613276
*/
13277-
if (c->rbytes > ((16+8)*1024)) {
13278-
/* The length of "stats prefixes" command cannot exceed 24 KB. */
13277+
if (c->rbytes > ((16+16)*1024)) {
1327913278
if (strncmp(ptr, "get ", 4) && strncmp(ptr, "gets ", 5)) {
1328013279
char buffer[16];
1328113280
memcpy(buffer, ptr, 15); buffer[15] = '\0';

t/coll_bop_delete.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ bop delete bkey1 0..0xFF: CLIENT_ERROR bad command line format
2424
bop delete bkey1 0x00..0xFFF: CLIENT_ERROR bad command line format
2525
bop delete bkey1 0x11..0xFFFF: NOT_FOUND_ELEMENT
2626
bop delete bkey1 0x00..0xFF 1 EQ 0x05: NOT_FOUND_ELEMENT
27-
bop delete bkey1 0x00..0xFF 32 EQ 0x05: CLIENT_ERROR bad command line format
27+
bop delete bkey1 0x00..0xFF 64 EQ 0x05: CLIENT_ERROR bad command line format
2828
bop delete bkey1 0x00..0xFF 1 XX 0x05: CLIENT_ERROR bad command line format
2929
bop delete bkey1 0x00..0xFF 0 & 0xFFFFFF EQ 0x03: CLIENT_ERROR bad command line format
3030
bop delete bkey1 0x00..0xFF 0 & 0xFFFFFF EQ 0x030303: NOT_FOUND_ELEMENT
@@ -115,7 +115,7 @@ $cmd = "bop delete bkey1 0x11..0xFFFF"; $rst = "NOT_FOUND_ELEMENT";
115115
mem_cmd_is($sock, $cmd, "", $rst);
116116
$cmd = "bop delete bkey1 0x00..0xFF 1 EQ 0x05"; $rst = "NOT_FOUND_ELEMENT";
117117
mem_cmd_is($sock, $cmd, "", $rst);
118-
$cmd = "bop delete bkey1 0x00..0xFF 32 EQ 0x05"; $rst = "CLIENT_ERROR bad command line format";
118+
$cmd = "bop delete bkey1 0x00..0xFF 64 EQ 0x05"; $rst = "CLIENT_ERROR bad command line format";
119119
mem_cmd_is($sock, $cmd, "", $rst);
120120
$cmd = "bop delete bkey1 0x00..0xFF 1 XX 0x05"; $rst = "CLIENT_ERROR bad command line format";
121121
mem_cmd_is($sock, $cmd, "", $rst);

t/coll_bop_insert.t

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ datum1
4343
setattr bkey1 maxcount=4000
4444
bop insert bkey1 0x020 6
4545
datum2
46-
bop insert bkey1 0x0202020202020202020202020202020202020202020202020202020202020202 6
46+
bop insert bkey1 0x02020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202 6
4747
datum2
4848
bop insert bkey1 0x0202 0x020 6
4949
datum2
50-
bop insert bkey1 0x0202 0x0202020202020202020202020202020202020202020202020202020202020202 6
50+
bop insert bkey1 0x0202 0x02020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202 6
5151
datum2
5252
bop insert bkey1 0x0202 02 6
5353
datum2
@@ -130,11 +130,11 @@ $cmd = "setattr bkey1 maxcount=4000"; $rst = "OK";
130130
mem_cmd_is($sock, $cmd, "", $rst);
131131
$cmd = "bop insert bkey1 0x020 6"; $rst = "CLIENT_ERROR bad command line format";
132132
mem_cmd_is($sock, $cmd, "", $rst);
133-
$cmd = "bop insert bkey1 0x0202020202020202020202020202020202020202020202020202020202020202 6"; $rst = "CLIENT_ERROR bad command line format";
133+
$cmd = "bop insert bkey1 0x02020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202 6"; $rst = "CLIENT_ERROR bad command line format";
134134
mem_cmd_is($sock, $cmd, "", $rst);
135135
$cmd = "bop insert bkey1 0x0202 0x020 6"; $rst = "CLIENT_ERROR bad command line format";
136136
mem_cmd_is($sock, $cmd, "", $rst);
137-
$cmd = "bop insert bkey1 0x0202 0x0202020202020202020202020202020202020202020202020202020202020202 6"; $rst = "CLIENT_ERROR bad command line format";
137+
$cmd = "bop insert bkey1 0x0202 0x02020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202 6"; $rst = "CLIENT_ERROR bad command line format";
138138
mem_cmd_is($sock, $cmd, "", $rst);
139139
$cmd = "bop insert bkey1 0x0202 02 6"; $rst = "CLIENT_ERROR bad command line format";
140140
mem_cmd_is($sock, $cmd, "", $rst);

t/coll_bop_update.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ datum2
9696
bop update bkey2 0x20 1 | 0xFF -1
9797
bop update bkey2 0x0020 1 | 0xFF -1
9898
bop update bkey2 0x0040 4 | 0xFF -1
99-
bop update bkey2 0x0040 32 | 0xFF -1
99+
bop update bkey2 0x0040 64 | 0xFF -1
100100
101101
delete bkey1
102102
delete bkey2
@@ -325,7 +325,7 @@ $cmd = "bop update bkey2 0x0020 1 | 0xFF -1"; $rst = "EFLAG_MISMATCH";
325325
mem_cmd_is($sock, $cmd, "", $rst);
326326
$cmd = "bop update bkey2 0x0040 4 | 0xFF -1"; $rst = "EFLAG_MISMATCH";
327327
mem_cmd_is($sock, $cmd, "", $rst);
328-
$cmd = "bop update bkey2 0x0040 32 | 0xFF -1"; $rst = "CLIENT_ERROR bad command line format";
328+
$cmd = "bop update bkey2 0x0040 64 | 0xFF -1"; $rst = "CLIENT_ERROR bad command line format";
329329
mem_cmd_is($sock, $cmd, "", $rst);
330330

331331
# Finalize

t/coll_bop_upsert.t

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ datum1
4444
setattr bkey1 maxcount=4000
4545
bop upsert bkey1 0x020 6
4646
datum2
47-
bop upsert bkey1 0x0202020202020202020202020202020202020202020202020202020202020202 6
47+
bop upsert bkey1 0x02020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202 6
4848
datum2
4949
bop upsert bkey1 0x0202 0x020 6
5050
datum2
51-
bop upsert bkey1 0x0202 0x0202020202020202020202020202020202020202020202020202020202020202 6
51+
bop upsert bkey1 0x0202 0x02020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202 6
5252
datum2
5353
bop upsert bkey1 0x0202 02 6
5454
datum2
@@ -131,11 +131,11 @@ $cmd = "setattr bkey1 maxcount=4000"; $rst = "OK";
131131
mem_cmd_is($sock, $cmd, "", $rst);
132132
$cmd = "bop upsert bkey1 0x020 6"; $rst = "CLIENT_ERROR bad command line format";
133133
mem_cmd_is($sock, $cmd, "", $rst);
134-
$cmd = "bop upsert bkey1 0x0202020202020202020202020202020202020202020202020202020202020202 6"; $rst = "CLIENT_ERROR bad command line format";
134+
$cmd = "bop upsert bkey1 0x02020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202 6"; $rst = "CLIENT_ERROR bad command line format";
135135
mem_cmd_is($sock, $cmd, "", $rst);
136136
$cmd = "bop upsert bkey1 0x0202 0x020 6"; $rst = "CLIENT_ERROR bad command line format";
137137
mem_cmd_is($sock, $cmd, "", $rst);
138-
$cmd = "bop upsert bkey1 0x0202 0x0202020202020202020202020202020202020202020202020202020202020202 6"; $rst = "CLIENT_ERROR bad command line format";
138+
$cmd = "bop upsert bkey1 0x0202 0x02020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202 6"; $rst = "CLIENT_ERROR bad command line format";
139139
mem_cmd_is($sock, $cmd, "", $rst);
140140
$cmd = "bop upsert bkey1 0x0202 02 6"; $rst = "CLIENT_ERROR bad command line format";
141141
mem_cmd_is($sock, $cmd, "", $rst);

0 commit comments

Comments
 (0)