Skip to content

Sharding keys on one range partition into on core#249

Merged
yi-xmu merged 3 commits intoeloq-10.6.10from
shard_keys_one_core_of_rangepartition
Mar 17, 2026
Merged

Sharding keys on one range partition into on core#249
yi-xmu merged 3 commits intoeloq-10.6.10from
shard_keys_one_core_of_rangepartition

Conversation

@yi-xmu
Copy link
Collaborator

@yi-xmu yi-xmu commented Mar 13, 2026

Update mtr test case

Update submodule

Summary by CodeRabbit

  • Tests

    • Updated many MySQL EXPLAIN/test expectations to reflect minor changes in optimizer row estimates, index hints and plan details.
    • Adjusted a test to add a short delay to avoid intermittent deadlocks during cleanup.
    • No public APIs or runtime behavior changed.
  • Chores

    • Updated a referenced infrastructure submodule pointer to a newer revision.

update mtr test case

update subm
update mtr test result
update subm based mar2

update mtr test

update subm
@yi-xmu yi-xmu self-assigned this Mar 13, 2026
@yi-xmu yi-xmu requested a review from liunyl March 13, 2026 10:51
@coderabbitai
Copy link

coderabbitai bot commented Mar 13, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 74814e69-d571-442e-ad08-a9c2c7bc814b

📥 Commits

Reviewing files that changed from the base of the PR and between 2242d96 and ae6c51f.

📒 Files selected for processing (1)
  • data_substrate
✅ Files skipped from review due to trivial changes (1)
  • data_substrate

Walkthrough

Updates the data_substrate submodule pointer (metadata-only), adjusts multiple MySQL test expectation files to reflect slight EXPLAIN/row-estimate differences, and adds a short sleep 3 in one test to avoid potential deadlocks during cleanup.

Changes

Cohort / File(s) Summary
Submodule Reference
data_substrate
Bumped submodule pointer from 65caaadd93da33fcfb6ee1a1cca73e89cb7529f7 to a64a31d7b5e87df17365794b995a325cdf153cb2 (metadata-only; no functional changes).
Test Result Files - EXPLAIN/Rows Adjustments
storage/eloq/mysql-test/mono_main/r/compress.result, storage/eloq/mysql-test/mono_main/r/select.result, storage/eloq/mysql-test/mono_main/r/select_jcl6.result, storage/eloq/mysql-test/mono_main/r/select_pkeycache.result, storage/eloq/mysql-test/mono_main/r/ssl.result, storage/eloq/mysql-test/mono_main/r/ssl_compress.result
Updated expected MySQL EXPLAIN outputs: small row-count shifts (e.g., 1199 → 1198/1200) and minor index/key/plan text variations; no SQL or runtime behavior changes.
Test Script Timing Workaround
storage/eloq/mysql-test/mono_main/t/subselect_sj.test
Inserted a short sleep 3 and a FIXME before dropping tables/restoring optimizer_switch to reduce risk of deadlocks during test teardown.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • liunyl

Poem

🐰 A tiny pointer hop, a gentle tide,
Rows drift by one, then nudge the other side,
Three breaths of sleep before the tables clear,
Tests settle down — no rabbit holes appear,
I twitch my whiskers and applaud the ride.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The pull request title is unclear and contains grammatical issues, making it difficult to understand the actual change. The phrase 'Sharding keys on one range partition into on core' is vague and doesn't clearly convey the primary objective. Revise the title to be more clear and grammatically correct, such as 'Shard keys on one range partition to single core' or similar phrasing that better describes the actual change being made.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch shard_keys_one_core_of_rangepartition
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

Migrating from UI to YAML configuration.

Use the @coderabbitai configuration command in a PR comment to get a dump of all your UI settings in YAML format. You can then edit this YAML file and upload it to the root of your repository to configure CodeRabbit programmatically.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
storage/eloq/mysql-test/mono_main/r/compress.result (1)

141-144: Normalize the estimate-only output here as well.

This file is asserting the same volatile EXPLAIN.rows and SHOW KEYS.Cardinality values as select.result. Since those numbers are planner/statistics artifacts rather than stable behavior, updating them in-place makes the compressed variant equally brittle to non-semantic engine changes.

Example MTR normalization
--replace_column 9 #
explain select fld3 from t2 ignore index (fld3) where fld3 = 'honeysuckle';

--replace_column 9 #
explain select fld3 from t2 where fld1=fld1;

--replace_column 9 #
explain select min(fld1),max(fld1),count(*) from t2;

--replace_column 7 #
show keys from t2;

Also applies to: 1267-1312, 1321-1321, 1375-1375, 1616-1616, 1668-1668, 1748-1750

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@storage/eloq/mysql-test/mono_main/r/compress.result` around lines 141 - 144,
The compressed test output records volatile planner/statistics fields
(EXPLAIN.rows and SHOW KEYS.Cardinality) that must be normalized; update
storage/eloq/mysql-test/mono_main/r/compress.result by adding MTR normalization
directives (e.g. --replace_column <col> #) for the EXPLAIN and SHOW KEYS blocks
referenced so the 9th column of EXPLAIN output and the Cardinality column in
SHOW KEYS are replaced with a stable marker; apply the same normalization to the
other mentioned ranges (1267-1312, 1321, 1375, 1616, 1668, 1748-1750) and to the
EXPLAIN lines around the queries like "explain select fld3 from t2 ..." and
"show keys from t2" so the file no longer asserts planner-estimated numbers.
storage/eloq/mysql-test/mono_main/r/select.result (1)

138-141: Avoid hard-coding volatile optimizer estimates in this result file.

These hunks only re-record EXPLAIN.rows / SHOW KEYS.Cardinality values (1198/1200). The suite already treats other unstable row estimates as placeholders, so pinning exact numbers here will keep causing result-only churn on harmless stats or planner changes. Please normalize those columns in the paired MTR test and keep the result focused on stable plan shape.

Example MTR normalization
--replace_column 9 #
explain select fld3 from t2 ignore index (fld3) where fld3 = 'honeysuckle';

--replace_column 9 #
explain select fld3 from t2 where fld1=fld1;

--replace_column 9 #
explain select min(fld1),max(fld1),count(*) from t2;

--replace_column 7 #
show keys from t2;

Also applies to: 550-550, 1260-1301, 1313-1313, 1366-1366, 1607-1607, 1659-1659, 1717-1719

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@storage/eloq/mysql-test/mono_main/r/select.result` around lines 138 - 141,
The result file hard-codes volatile optimizer estimates (EXPLAIN.rows and SHOW
KEYS Cardinality like "1198"/"1200"); update the paired MTR test to normalize
those columns instead of recording exact numbers: add --replace_column 9 # for
the EXPLAIN lines (e.g. the EXPLAIN for "explain select fld3 from t2 use index
(fld1) where fld3 = 'honeysuckle';" and other EXPLAINs) and add --replace_column
7 # for SHOW KEYS output (e.g. "show keys from t2;"), so the test compares
stable plan shape not fluctuating row/cardinality estimates.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@storage/eloq/mysql-test/mono_main/t/subselect_sj.test`:
- Around line 2909-2910: Replace the time-based workaround (--sleep 3) with a
deterministic bounded-retry cleanup around the DROP statement: detect the
transient deadlock/lock condition (e.g., check for active split-range/locks or
failed DROP error code) and retry the DROP in a small loop with exponential
backoff and a max attempt limit, failing the test only after the limit; update
the FIXME comment to include the tracked issue ID so it remains linked to the
bug. Locate the cleanup/drop logic in this test (the DROP TABLE / cleanup
sequence adjacent to the sleep) and implement the retry/wait there, ensuring you
only retry on the specific transient error conditions and not on permanent
failures.

---

Nitpick comments:
In `@storage/eloq/mysql-test/mono_main/r/compress.result`:
- Around line 141-144: The compressed test output records volatile
planner/statistics fields (EXPLAIN.rows and SHOW KEYS.Cardinality) that must be
normalized; update storage/eloq/mysql-test/mono_main/r/compress.result by adding
MTR normalization directives (e.g. --replace_column <col> #) for the EXPLAIN and
SHOW KEYS blocks referenced so the 9th column of EXPLAIN output and the
Cardinality column in SHOW KEYS are replaced with a stable marker; apply the
same normalization to the other mentioned ranges (1267-1312, 1321, 1375, 1616,
1668, 1748-1750) and to the EXPLAIN lines around the queries like "explain
select fld3 from t2 ..." and "show keys from t2" so the file no longer asserts
planner-estimated numbers.

In `@storage/eloq/mysql-test/mono_main/r/select.result`:
- Around line 138-141: The result file hard-codes volatile optimizer estimates
(EXPLAIN.rows and SHOW KEYS Cardinality like "1198"/"1200"); update the paired
MTR test to normalize those columns instead of recording exact numbers: add
--replace_column 9 # for the EXPLAIN lines (e.g. the EXPLAIN for "explain select
fld3 from t2 use index (fld1) where fld3 = 'honeysuckle';" and other EXPLAINs)
and add --replace_column 7 # for SHOW KEYS output (e.g. "show keys from t2;"),
so the test compares stable plan shape not fluctuating row/cardinality
estimates.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 82b7469c-d6b3-4678-8d06-08ac1da350ad

📥 Commits

Reviewing files that changed from the base of the PR and between 82c9599 and b3a802a.

📒 Files selected for processing (8)
  • data_substrate
  • storage/eloq/mysql-test/mono_main/r/compress.result
  • storage/eloq/mysql-test/mono_main/r/select.result
  • storage/eloq/mysql-test/mono_main/r/select_jcl6.result
  • storage/eloq/mysql-test/mono_main/r/select_pkeycache.result
  • storage/eloq/mysql-test/mono_main/r/ssl.result
  • storage/eloq/mysql-test/mono_main/r/ssl_compress.result
  • storage/eloq/mysql-test/mono_main/t/subselect_sj.test

Comment on lines +2909 to +2910
# FIXME: Temporary. To avoid deadlock caused by split range and drop table.
--sleep 3
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Replace time-based deadlock workaround with deterministic synchronization/retry

At Line 2910, --sleep 3 is timing-dependent and can still be flaky across environments. It also masks the underlying deadlock condition instead of making cleanup robust. Please switch this to a deterministic cleanup strategy (bounded retry/wait condition around the drop path) and keep the FIXME tied to a tracked issue ID.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@storage/eloq/mysql-test/mono_main/t/subselect_sj.test` around lines 2909 -
2910, Replace the time-based workaround (--sleep 3) with a deterministic
bounded-retry cleanup around the DROP statement: detect the transient
deadlock/lock condition (e.g., check for active split-range/locks or failed DROP
error code) and retry the DROP in a small loop with exponential backoff and a
max attempt limit, failing the test only after the limit; update the FIXME
comment to include the tracked issue ID so it remains linked to the bug. Locate
the cleanup/drop logic in this test (the DROP TABLE / cleanup sequence adjacent
to the sleep) and implement the retry/wait there, ensuring you only retry on the
specific transient error conditions and not on permanent failures.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
data_substrate (1)

1-1: Document the submodule update in the PR description.

The submodule pointer update is valid. However, the recent commit history shows this repository follows a practice of including descriptive commit messages for submodule updates (e.g., "eloqstore bug fixes", "extend log retention"). Adding a brief description of what functional changes are included in the new data_substrate commit would improve traceability for future debugging and be consistent with established patterns in the codebase.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@data_substrate` at line 1, Add a short descriptive note about the submodule
pointer update for data_substrate to the PR description: summarize the key
functional changes introduced by the new data_substrate commit (e.g., bug fixes,
API changes, retention/behavior tweaks), mention the new commit hash and any
impacted areas or migration steps, and follow the established style used in
prior messages like "eloqstore bug fixes" or "extend log retention" so the PR
description and commit history remain traceable.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@data_substrate`:
- Line 1: Add a short descriptive note about the submodule pointer update for
data_substrate to the PR description: summarize the key functional changes
introduced by the new data_substrate commit (e.g., bug fixes, API changes,
retention/behavior tweaks), mention the new commit hash and any impacted areas
or migration steps, and follow the established style used in prior messages like
"eloqstore bug fixes" or "extend log retention" so the PR description and commit
history remain traceable.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 48078840-f5b8-4f1c-bc55-b484a8cf44e1

📥 Commits

Reviewing files that changed from the base of the PR and between b3a802a and 2242d96.

📒 Files selected for processing (1)
  • data_substrate

@yi-xmu yi-xmu removed the trigger-ci label Mar 17, 2026
@yi-xmu yi-xmu merged commit dab5150 into eloq-10.6.10 Mar 17, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants