Skip to content

Commit 31d3045

Browse files
Copilotchejinge
andauthored
docs: Translate Chinese-suffixed documentation articles to English (#3246)
* docs: translate Chinese-suffixed articles to English Agent-Logs-Url: https://github.com/OpenAtomFoundation/pikiwidb/sessions/fac91351-84b2-4343-be78-54f63d7de8d0 Co-authored-by: chejinge <64316617+chejinge@users.noreply.github.com> * docs: address review feedback in translated docs Agent-Logs-Url: https://github.com/OpenAtomFoundation/pikiwidb/sessions/fac91351-84b2-4343-be78-54f63d7de8d0 Co-authored-by: chejinge <64316617+chejinge@users.noreply.github.com> * docs: polish punctuation and wording in translated guides Agent-Logs-Url: https://github.com/OpenAtomFoundation/pikiwidb/sessions/fac91351-84b2-4343-be78-54f63d7de8d0 Co-authored-by: chejinge <64316617+chejinge@users.noreply.github.com> * docs: restore all Chinese files to original Chinese content Agent-Logs-Url: https://github.com/OpenAtomFoundation/pikiwidb/sessions/eabc8a64-d2bd-4967-a92b-d2346e5608c7 Co-authored-by: chejinge <64316617+chejinge@users.noreply.github.com> * docs: add English translations for all Chinese documentation files Create English translation files for all 29 Chinese documentation files: - docs/introduce_en.md - docs/catalogue_en.md - docs/USERS_en.md - docs/design/architecture_en.md - docs/design/coding_en.md - docs/design/thread_en.md - docs/design/lock_en.md - docs/design/nemo_en.md - docs/design/blackwidow_en.md - docs/design/sync_en.md - docs/design/snapshot_en.md - docs/design/consistency_en.md - docs/ops/API_en.md - docs/ops/APIDifference_en.md - docs/ops/FAQ_en.md - docs/ops/MultiDB_en.md - docs/ops/adminComnand_en.md - docs/ops/bestPractice_en.md - docs/ops/client_en.md - docs/ops/config_en.md - docs/ops/dualMaster_en.md - docs/ops/infoCommand_en.md - docs/ops/install_en.md - docs/ops/memoryUsage_en.md - docs/ops/migrateslotCommand_en.md - docs/ops/pikaVsSSDB_en.md - docs/ops/shardingAPI_en.md - docs/ops/shardingTutorials_en.md - docs/ops/upgrade_en.md All Chinese text has been translated to English. Code blocks, URLs, image references, file paths, and markdown formatting are preserved. Original Chinese files are not modified. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: chejinge <64316617+chejinge@users.noreply.github.com> * docs: add English translations for Chinese documentation files Translate the following Chinese documentation files to English: - tools/pika_benchmark/README_ZH.md → README_en.md - tools/codis2pika/README_zh.md → README_en.md - tools/codis2pika/docs/quick_start.md → quick_start_en.md - tools/codis2pika/CHANGES.md → CHANGES_en.md - tools/pika_migrate/pika-migrate.md → pika-migrate_en.md - tools/benchmark_client/README.md → README_en.md - tools/bigkey_analyzer/README.md → README_en.md - tools/redis-copy/README.MD → README_en.MD - tests/README.md → README_en.md Skipped (already in English): - tools/pika-port/README.md - tools/pika-port/pika_port_3/readme.md - tests/integration/README_CN.md (English version README.md already exists) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: chejinge <64316617+chejinge@users.noreply.github.com> * docs: add English translation for codis/doc/redis_change_zh.md Agent-Logs-Url: https://github.com/OpenAtomFoundation/pikiwidb/sessions/eabc8a64-d2bd-4967-a92b-d2346e5608c7 Co-authored-by: chejinge <64316617+chejinge@users.noreply.github.com> * docs: update committers list in MAINTAINERS.md - remove 10 members, add machily and QX Agent-Logs-Url: https://github.com/OpenAtomFoundation/pikiwidb/sessions/c9c170aa-180e-442f-b6b7-d3eac99d8653 Co-authored-by: chejinge <64316617+chejinge@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: chejinge <64316617+chejinge@users.noreply.github.com> Co-authored-by: chejinge <945997690@qq.com>
1 parent e7b5538 commit 31d3045

40 files changed

Lines changed: 4095 additions & 10 deletions

MAINTAINERS.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,8 @@ Committers have a sustained history of high-quality contributions across multipl
3030
| [@chenbt-hz](https://github.com/chenbt-hz) | chenbt |
3131
| [@guangkun123](https://github.com/guangkun123) | guangkun |
3232
| [@wanghenshui](https://github.com/wanghenshui) | wanghenshui |
33-
| [@QlQlqiqi](https://github.com/QlQlqiqi) | QlQl |
34-
| [@cheniujh](https://github.com/cheniujh) | cheniujh |
35-
| [@YuCai18](https://github.com/YuCai18) | Yu Cai |
36-
| [@XiaoLiang2333](https://github.com/XiaoLiang2333) | DawnBeams |
37-
| [@luky116](https://github.com/luky116) | JayLiu |
38-
| [@buzhimingyonghu](https://github.com/buzhimingyonghu) | buzhimingyonghu |
39-
| [@dingxiaoshuai123](https://github.com/dingxiaoshuai123) | dingxiaoshuai |
40-
| [@lqxhub](https://github.com/lqxhub) | lqxhub |
41-
| [@chengyu-l](https://github.com/chengyu-l) | chengyu-l |
42-
| [@baerwang](https://github.com/baerwang) | baerwang |
33+
| [@machily](https://github.com/machily) | machily |
34+
| [@QX](https://github.com/QX) | QX |
4335

4436
## Notable Contributors
4537

codis/doc/redis_change_en.md

Lines changed: 266 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,266 @@
1+
### Redis Modifications (Additional Commands)
2+
--------------------------------
3+
4+
##### SLOTSINFO [start] [count]
5+
6+
+ Description: Returns slot metadata in Redis, including slot ID and key count for each slot.
7+
8+
+ Parameters: Defaults to querying `[0, MAX_SLOT_NUM)`.
9+
10+
- `start`: starting slot ID (default `0`)
11+
- `count`: size of the range to query, i.e. `[start, start + count)` (default `MAX_SLOT_NUM`)
12+
13+
+ Return: an array of `slotinfo` items, where each `slotinfo` is `[slotnum, slotsize]`.
14+
15+
response := []slotinfo{slot1, slot2, slot3, ...}
16+
slotinfo := []int{slotnum, slotsize}
17+
18+
where:
19+
INT slotnum : slot ID
20+
INT slotsize : number of keys in the slot
21+
22+
+ Example:
23+
24+
localhost:6379> slotsinfo 0 128
25+
1) 1) (integer) 23
26+
2) (integer) 2
27+
2) 1) (integer) 29
28+
2) (integer) 1
29+
30+
##### SLOTSSCAN slotnum cursor [COUNT count]
31+
32+
+ Description: Scans keys in a specific slot.
33+
34+
+ Parameters: Similar to `SCAN`.
35+
36+
- `slotnum`: slot ID to scan, in `[0, MAX_SLOT_NUM)`
37+
- `cursor`: same semantics as `SCAN`
38+
- `[COUNT count]`: same semantics as `SCAN`
39+
- `MATCH` is currently not supported
40+
41+
+ Return: same format as `SCAN`.
42+
43+
- Returns updated cursor and a key list.
44+
45+
+ Example:
46+
47+
localhost:6379> slotsscan 579 0 COUNT 10
48+
1) "10752"
49+
2) 1) "{a}7836"
50+
2) "{a}2167"
51+
3) "{a}5332"
52+
4) "{a}6292"
53+
5) "{a}600"
54+
6) "{a}6094"
55+
7) "{a}7754"
56+
8) "{a}4929"
57+
9) "{a}9211"
58+
10) "{a}6596"
59+
60+
##### SLOTSDEL slot1 [slot2 …]
61+
62+
+ Description: Deletes all key-value pairs in one or more slots.
63+
64+
+ Parameters: Accepts at least one slot ID.
65+
66+
+ Return: Same structure as `slotsinfo`; `slotsize` means remaining keys after deletion (usually `0`).
67+
68+
+ Example:
69+
70+
localhost:6379> slotsdel 1013 990
71+
1) 1) (integer) 1013
72+
2) (integer) 0
73+
2) 1) (integer) 990
74+
2) (integer) 0
75+
76+
#### Data Migration
77+
---------------
78+
79+
**The following 4 commands are a migration family:**
80+
81+
+ `SLOTSMGRTSLOT` - *O(1)*
82+
83+
Randomly migrates one key-value pair from a slot to the target node.
84+
85+
+ `SLOTSMGRTONE` - *O(1)*
86+
87+
Migrates the specified key-value pair to the target node.
88+
89+
+ `SLOTSMGRTTAGSLOT` - *O(log(n))*
90+
91+
Randomly picks one key from a slot and migrates all key-value pairs with the same tag.
92+
93+
+ `SLOTSMGRTTAGONE` - *O(log(n))*
94+
95+
Migrates all key-value pairs that share the same tag as the specified key.
96+
97+
##### SLOTSMGRTSLOT host port timeout slot
98+
99+
+ Description: Randomly migrates one key-value pair from the specified slot to the target node (synchronous I/O).
100+
101+
- Returns `0` if the slot is empty or the selected key expired.
102+
- If the slot still has keys, one key is selected and migrated.
103+
- Also returns the remaining key count in the slot.
104+
- Migration triggers `slotsrestore` on the destination and **overwrites existing values**.
105+
106+
+ Parameters:
107+
108+
- `host:port`: destination node
109+
110+
Redis caches the connection to `host:port` for 30s, and closes it on timeout/error.
111+
112+
- `timeout`: timeout in milliseconds
113+
114+
The operation includes three synchronous stages:
115+
116+
1. connect (may use cached connection)
117+
2. send key-value data
118+
3. receive response from destination
119+
120+
Each stage is bounded by `timeout`.
121+
122+
- `slot`: slot ID to migrate from
123+
124+
+ Return: integer array
125+
126+
response := []int{succ,size}
127+
128+
where:
129+
INT succ : migration result
130+
0 -> slot is empty (migrated keys = 0)
131+
1 -> one key migrated and removed locally (migrated keys = 1)
132+
INT size : remaining key count in the slot
133+
134+
+ Example:
135+
136+
localhost:6379> set a 100 # set <a, 100>
137+
OK
138+
localhost:6379> slotsinfo # slot size = 1
139+
1) 1) (integer) 579
140+
2) (integer) 1
141+
localhost:6379> slotsmgrt 127.0.0.1 6380 100 579
142+
(integer) 1 # migrated successfully
143+
localhost:6379> slotsinfo
144+
(empty list or set)
145+
localhost:6379> slotsmgrt 127.0.0.1 6380 100 579 1
146+
(integer) 0 # migrated count = 0; slot already empty
147+
148+
##### SLOTSMGRTONE host port timeout key
149+
150+
+ Description: Migrates the specified key to the destination. Semantics are similar to `slotsmgrtslot`.
151+
152+
+ Parameters: see `slotsmgrtslot`.
153+
154+
+ Return: integer
155+
156+
response := int(succ)
157+
158+
where:
159+
INT succ : same semantics as `slotsmgrtslot`
160+
161+
+ Example:
162+
163+
localhost:6379> set a 100 # set <a, 100>
164+
OK
165+
localhost:6379> slotsinfo
166+
1) 1) (integer) 579
167+
2) (integer) 1
168+
localhost:6379> slotsmgrtone 127.0.0.1 6380 100 a
169+
(integer) 1 # migration succeeded
170+
localhost:6379> slotsmgrtone 127.0.0.1 6380 100 a
171+
(integer) 0 # skipped: key does not exist locally
172+
173+
##### SLOTSMGRTTAGONE host port timeout key
174+
175+
+ Description: Migrates all keys that share the same tag as `key`.
176+
177+
- If `key` has no valid tag, it degrades to `slotsmgrtone`, with complexity ***O(1)***.
178+
- If `key` has a valid tag, it hashes the tag and finds all matching keys in skiplist, then migrates them atomically, with complexity ***O(log(n))***.
179+
- Note: In the modified Redis, tagged keys are organized in a skiplist by tag hash. Migration by tag may include more keys with the same hash. This design reduces string comparisons during tag migration and improves performance.
180+
181+
+ Parameters: see `slotsmgrtone`.
182+
183+
+ Return: integer
184+
185+
response := int(succ)
186+
187+
where:
188+
INT succ : number of keys migrated successfully
189+
190+
+ Example:
191+
192+
localhost:6379> set a{tag} 100 # set <a{tag}, 100>
193+
OK
194+
localhost:6379> set b{tag} 100 # set <b{tag}, 100>
195+
OK
196+
localhost:6379> slotsmgrttag 127.0.0.1 6380 1000 {tag}
197+
(integer) 2
198+
localhost:6379> scan 0 # migrated, no local data
199+
1) "0"
200+
2) (empty list or set)
201+
localhost:6380> scan 0 # data appears on destination
202+
1) "0"
203+
2) 1) "a{tag}"
204+
2) "b{tag}"
205+
206+
##### SLOTSMGRTTAGSLOT host port timeout slot
207+
208+
+ Description: Tag-based migration counterpart of `slotsmgrtslot`.
209+
210+
- Refer to `slotsmgrtslot` and `slotsmgrttagone` for behavior details.
211+
212+
##### SLOTSRESTORE key1 ttl1 val1 [key2 ttl2 val2 …]
213+
214+
+ Description: Extension of Redis 2.8 `restore` command.
215+
216+
- Supports restoring multiple key-value pairs at once.
217+
- The operation is atomic.
218+
219+
+ Note: Unlike `restore`, `slotsrestore` only supports `replace`, i.e. it always **overwrites old values**. If old values already exist, it is usually a bug in redis-slots or proxy implementation, and Redis logs a conflict record.
220+
221+
#### Debug Commands
222+
---------------
223+
224+
##### SLOTSHASHKEY key1 [key2 …]
225+
226+
+ Description: Computes and returns slot IDs of input keys.
227+
228+
+ Parameters: one or more keys.
229+
230+
+ Return: array
231+
232+
response := []int{slot1, slot2...}
233+
234+
where:
235+
INT slot : slot ID of the key, i.e. hash32(key) % NUM_OF_SLOTS
236+
237+
+ Example:
238+
239+
localhost:6379> slotshashkey a b c # compute slot IDs of <a,b,c>
240+
1) (integer) 579
241+
2) (integer) 1017
242+
3) (integer) 879
243+
244+
##### SLOTSCHECK
245+
246+
+ Description: Performs slot consistency checking in Redis. It verifies:
247+
248+
- Every key recorded in a slot exists in DB.
249+
- Every DB key can be found in its corresponding slot.
250+
251+
+ Parameters: no arguments.
252+
253+
+ Return: string `OK` on success (or `ERR` with related key when check fails).
254+
255+
+ Example:
256+
257+
localhost:6379> set a 100 # set <a, 100>
258+
OK
259+
localhost:6379> slotscheck
260+
OK # check passed
261+
262+
localhost:6379> slotscheck
263+
OK # check passed, took 1.07s
264+
(1.07s)
265+
266+
+ **Note**: This operation is relatively slow and should be used only as a development/debugging tool, not in production.

0 commit comments

Comments
 (0)