@@ -163,6 +163,127 @@ jobs:
163163 if : always()
164164 run : docker rm --force recall-effort-oceanbase || true
165165
166+ atomic-memory-clean-oceanbase :
167+ name : Atomic Memory clean migration (OceanBase)
168+ if : github.event_name != 'workflow_dispatch' || inputs.suite != 'recall-effort'
169+ runs-on : ubuntu-latest
170+ timeout-minutes : 60
171+ env :
172+ OCEANBASE_IMAGE : ghcr.io/oceanbase/oceanbase-ce:4.3.5.6-106000012026040916
173+ POWERCONTEXT_TEST_MIGRATION_OCEANBASE_URL : >-
174+ mysql+aoceanbase://root%40test:powercontext-e2e@127.0.0.1:2881/powercontext_test?charset=utf8mb4
175+ PYTHONUNBUFFERED : " 1"
176+ MIGRATION_REPORTS : ${{ github.workspace }}/.powercontext/atomic-memory-clean-oceanbase
177+ steps :
178+ - name : Check out
179+ uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
180+ with :
181+ persist-credentials : false
182+
183+ - name : Set up the environment
184+ uses : ./.github/actions/setup-python-env
185+ with :
186+ python-version : " 3.12"
187+
188+ - name : Start the isolated OceanBase test instance
189+ run : |
190+ docker run --detach --name atomic-memory-clean-oceanbase \
191+ --publish 127.0.0.1:2881:2881 \
192+ --ulimit nofile=65536:65536 \
193+ --env MODE=slim \
194+ --env OB_DATABASE=powercontext_test \
195+ --env OB_TENANT_PASSWORD=powercontext-e2e \
196+ "$OCEANBASE_IMAGE"
197+ for attempt in $(seq 1 120); do
198+ if docker exec atomic-memory-clean-oceanbase \
199+ obclient -h127.0.0.1 -P2881 -uroot@test -ppowercontext-e2e \
200+ -Dpowercontext_test -e 'SELECT 1' >/dev/null 2>&1; then
201+ # The slim image's default 1 GB maximum is too small for the
202+ # indexes created across the clean migration acceptance cases.
203+ docker exec atomic-memory-clean-oceanbase \
204+ obclient -h127.0.0.1 -P2881 -uroot@sys \
205+ -e "ALTER SYSTEM SET datafile_maxsize='8G'; ALTER SYSTEM SET datafile_next='512M'; ALTER SYSTEM SET datafile_size='4G';"
206+ datafile_ready=false
207+ for config_attempt in $(seq 1 30); do
208+ docker exec atomic-memory-clean-oceanbase \
209+ obclient -h127.0.0.1 -P2881 -uroot@sys --batch --skip-column-names \
210+ -e "SHOW PARAMETERS WHERE name IN ('datafile_size', 'datafile_maxsize', 'datafile_next');" \
211+ > "$RUNNER_TEMP/atomic-memory-datafile.tsv"
212+ if awk '
213+ $5 == "datafile_size" && $7 == "4G" { size = 1 }
214+ $5 == "datafile_maxsize" && $7 == "8G" { maximum = 1 }
215+ $5 == "datafile_next" && $7 == "512M" { increment = 1 }
216+ END { exit !(size && maximum && increment) }
217+ ' "$RUNNER_TEMP/atomic-memory-datafile.tsv"; then
218+ datafile_ready=true
219+ break
220+ fi
221+ sleep 2
222+ done
223+ cat "$RUNNER_TEMP/atomic-memory-datafile.tsv"
224+ if [ "$datafile_ready" != true ]; then
225+ echo 'OceanBase datafile configuration did not become effective within one minute.' >&2
226+ exit 1
227+ fi
228+ docker exec atomic-memory-clean-oceanbase \
229+ obclient -h127.0.0.1 -P2881 -uroot@test -ppowercontext-e2e \
230+ -Dpowercontext_test \
231+ -e "SET GLOBAL recyclebin=OFF; SELECT VERSION(); SHOW VARIABLES LIKE 'ob_compatibility_mode'; SHOW VARIABLES LIKE 'recyclebin';"
232+ exit 0
233+ fi
234+ if [ "$(docker inspect --format '{{.State.Running}}' atomic-memory-clean-oceanbase)" != true ]; then
235+ echo 'OceanBase exited before becoming ready.' >&2
236+ exit 1
237+ fi
238+ sleep 5
239+ done
240+ echo 'OceanBase did not become ready within 10 minutes.' >&2
241+ exit 1
242+
243+ - name : Run clean migration evidence, grants and vectors without skips
244+ timeout-minutes : 45
245+ run : |
246+ uv run --locked python scripts/run_atomic_memory_clean_migration.py \
247+ oceanbase --output "$MIGRATION_REPORTS"
248+
249+ - name : Collect the database log
250+ if : always()
251+ run : |
252+ mkdir -p "$MIGRATION_REPORTS"
253+ docker logs atomic-memory-clean-oceanbase > "$MIGRATION_REPORTS/oceanbase.log" 2>&1 || true
254+ for logfile in observer.log observer.log.wf; do
255+ docker exec atomic-memory-clean-oceanbase tail -n 20000 "/root/demo/log/$logfile" \
256+ > "$MIGRATION_REPORTS/$logfile" 2>&1 || true
257+ done
258+ docker inspect --format 'MemoryBytes={{.HostConfig.Memory}} NanoCpus={{.HostConfig.NanoCpus}} CpuQuota={{.HostConfig.CpuQuota}}' \
259+ atomic-memory-clean-oceanbase > "$MIGRATION_REPORTS/container-resources.txt" 2>&1 || true
260+ docker stats --no-stream atomic-memory-clean-oceanbase \
261+ > "$MIGRATION_REPORTS/container-stats.txt" 2>&1 || true
262+ docker exec atomic-memory-clean-oceanbase \
263+ obclient -h127.0.0.1 -P2881 -uroot@sys \
264+ -e "SHOW PARAMETERS WHERE name IN ('datafile_size', 'datafile_maxsize', 'datafile_next', 'memory_limit', 'system_memory', 'cpu_count');" \
265+ > "$MIGRATION_REPORTS/database-parameters.txt" 2>&1 || true
266+
267+ - name : Save complete observer logs on failure
268+ if : failure()
269+ run : |
270+ mkdir -p "$MIGRATION_REPORTS/observer"
271+ docker cp atomic-memory-clean-oceanbase:/root/demo/log/. "$MIGRATION_REPORTS/observer/" || true
272+
273+ - name : Save clean migration reports
274+ if : always()
275+ uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
276+ with :
277+ name : atomic-memory-clean-oceanbase-${{ github.sha }}
278+ path : ${{ env.MIGRATION_REPORTS }}/
279+ include-hidden-files : true
280+ if-no-files-found : error
281+ retention-days : 7
282+
283+ - name : Stop and remove the test instance
284+ if : always()
285+ run : docker rm --force atomic-memory-clean-oceanbase || true
286+
166287 acceptance :
167288 needs : validate
168289 runs-on : ubuntu-latest
0 commit comments