Skip to content

replayer: support to load directories dynamically#973

Merged
ti-chi-bot[bot] merged 2 commits into
pingcap:mainfrom
YangKeao:dynamic-replayer
Nov 7, 2025
Merged

replayer: support to load directories dynamically#973
ti-chi-bot[bot] merged 2 commits into
pingcap:mainfrom
YangKeao:dynamic-replayer

Conversation

@YangKeao
Copy link
Copy Markdown
Member

@YangKeao YangKeao commented Nov 6, 2025

What problem does this PR solve?

Issue Number: close #968

Problem Summary:

What is changed and how it works:

  1. Add three flags: "dynamic-input", "replayer-count" and "replayer-index". The meaning of input has a little change.
  2. A new struct DirWatcher is used to walk the folder and create decoder dynamically.

Limitation: This PR only supports to have a single input for dynamic-input. It's indeed not difficult to support but we can make it simpler (to develop and to test) with this limitation. I think it can still cover the current scenario.

You can run the S3 tests locally with minio:

docker run -d --rm \
  -p 9000:9000 \
  -p 9001:9001 \
  --name minio-test \
  -e "MINIO_ROOT_USER=minioadmin" \
  -e "MINIO_ROOT_PASSWORD=minioadmin" \
  minio/minio server /data --console-address ":9001"
S3_URL_FOR_TEST="s3://test-bucket?force-path-style=true&endpoint=http://127.0.0.1:9000&access-key=minioadmin&secret-access-key=minioadmin&provider=minio" go test -timeout 30s -tags intest,enterprise, -run ^TestS3DirWatcherWithRealS3$ github.com/pingcap/tiproxy/pkg/sqlreplay/store
S3_URL_FOR_TEST="s3://test-bucket?force-path-style=true&endpoint=http://127.0.0.1:9000&access-key=minioadmin&secret-access-key=minioadmin&provider=minio" go test -timeout 30s -tags intest,enterprise, -run ^TestDynamicInput$ github.com/pingcap/tiproxy/pkg/sqlreplay/replay

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Notable changes

  • Has configuration change
  • Has HTTP API interfaces change
  • Has tiproxyctl change
  • Other user behavior changes

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot ti-chi-bot Bot requested review from bb7133 and xhebox November 6, 2025 14:58
@ti-chi-bot ti-chi-bot Bot added the size/XXL label Nov 6, 2025
Signed-off-by: Yang Keao <yangkeao@chunibyo.icu>
@YangKeao YangKeao force-pushed the dynamic-replayer branch 5 times, most recently from 8b6f1fe to c7822cb Compare November 6, 2025 16:55
Signed-off-by: Yang Keao <yangkeao@chunibyo.icu>
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 63.54839% with 113 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@70a6283). Learn more about missing BASE report.

Files with missing lines Patch % Lines
pkg/sqlreplay/replay/replay.go 59.37% 47 Missing and 18 partials ⚠️
pkg/sqlreplay/store/dir_watcher.go 72.27% 19 Missing and 9 partials ⚠️
pkg/server/api/traffic.go 6.66% 12 Missing and 2 partials ⚠️
cmd/replayer/main.go 0.00% 6 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #973   +/-   ##
=======================================
  Coverage        ?   67.46%           
=======================================
  Files           ?      137           
  Lines           ?    13885           
  Branches        ?        0           
=======================================
  Hits            ?     9367           
  Misses          ?     3850           
  Partials        ?      668           
Flag Coverage Δ
unit 67.46% <63.54%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented Nov 7, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: djshow832

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot Bot added the lgtm label Nov 7, 2025
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented Nov 7, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-11-07 09:48:40.503899061 +0000 UTC m=+436369.946928930: ☑️ agreed by djshow832.

@ti-chi-bot ti-chi-bot Bot added the approved label Nov 7, 2025
@ti-chi-bot ti-chi-bot Bot merged commit 23a70a1 into pingcap:main Nov 7, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automatically detect new TiDB audit log path

3 participants