Commit 2f117e0
committed
refactor(ENG-3514): complete Redis migration - remove Name() and simplify Store logic
BREAKING: Storage interface no longer has Name() method. All backends now behave like Redis:
- Add() is idempotent and returns error if sandbox already exists (no ErrAlreadyExists tolerance)
- Reconcile() always kills orphans (no re-add logic for memory backend)
- Removed manual reservation handling in Add() (Redis handles this separately)
Changes:
- Remove StorageNameMemory, StorageNameRedis, StorageNamePopulateRedis constants
- Remove Name() method from Storage interface and all implementations
- Simplify Store.Add(): no ErrAlreadyExists tolerance, always call AddSandboxToRoutingTable
- Simplify Store.Reconcile(): always kill orphans (Redis-only behavior)
- Remove manual Reserve() call in Store.Add() (Redis backend doesn't need it)
Tests:
- Fix TestAdd_AlreadyInCache: now expects error on duplicate Add
- Fix TestAdd_NotNewlyCreated: now expects error on duplicate Add
- Fix TestAdd_ConcurrentCalls: concurrent adds for same sandbox now only first succeeds
- Add TestAdd_AddSandboxToRoutingTableAlwaysCalled: verify callback always called
- Add TestAdd_StorageErrorHandling: verify storage errors propagate immediately
- Add TestReconcile_CallsRemoveSandboxFromNode: verify orphans are killed (mock-based)
- Add TestENG3514_MigrationComplete: migration checklist verification
All tests pass with -race flag. Build successful.1 parent 3923ddf commit 2f117e0
5 files changed
Lines changed: 327 additions & 92 deletions
File tree
- packages/api/internal/sandbox
- storage
- memory
- populate_redis
- redis
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | 15 | | |
18 | 16 | | |
19 | 17 | | |
| |||
Lines changed: 0 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
24 | 22 | | |
25 | 23 | | |
26 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
39 | 37 | | |
40 | 38 | | |
41 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | 31 | | |
36 | 32 | | |
37 | 33 | | |
| |||
40 | 36 | | |
41 | 37 | | |
42 | 38 | | |
43 | | - | |
44 | | - | |
45 | | - | |
| 39 | + | |
46 | 40 | | |
47 | 41 | | |
48 | 42 | | |
| |||
101 | 95 | | |
102 | 96 | | |
103 | 97 | | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
| 98 | + | |
| 99 | + | |
117 | 100 | | |
118 | 101 | | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
| 102 | + | |
| 103 | + | |
131 | 104 | | |
132 | 105 | | |
133 | 106 | | |
| |||
178 | 151 | | |
179 | 152 | | |
180 | 153 | | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
205 | 165 | | |
| 166 | + | |
| 167 | + | |
206 | 168 | | |
207 | 169 | | |
208 | 170 | | |
| |||
0 commit comments