Skip to content

fix: close remaining sharding correctness holes - #59

Merged
renecannao merged 1 commit into
fix/shard-derived-sort-sqlfrom
fix/shard-having-join-2pc
Aug 19, 2026
Merged

fix: close remaining sharding correctness holes#59
renecannao merged 1 commit into
fix/shard-derived-sort-sqlfrom
fix/shard-having-join-2pc

Conversation

@renecannao

Copy link
Copy Markdown
Collaborator

Summary

Stacked on #58.

  • Multi-table DML: fail closed if any table is sharded or backends differ.
  • HAVING: rewrite COUNT(*) / other aggs to aggregate-output columns.
  • Co-located joins: same shard layout + equi-join on each table's shard key → per-shard JOIN SQL.
  • 2PC in tools: backend mode uses DistributedTransactionManager; in-txn SELECTs use pinned sessions. sqlengine --txn-log PATH optional.

Validation

  • ./run_tests --gtest_brief=1: 1320 passed, 38 skipped
  • ./run_tests --gtest_filter='PlanExecutorTest.Having*:DistributedPlannerTest.Having*:DistributedPlannerTest.Colocated*:DistributedDmlTest.MultiTable*'
  • sqlengine.cpp and mysql_server.cpp compile

Refuse multi-table UPDATE/DELETE when any table is sharded or backends
differ. Evaluate HAVING against aggregate output so COUNT(*) filters
work locally and distributed. Push equi-joins of same-layout sharded
tables to each shard. sqlengine and mysql_server use 2PC when backends
are configured; SELECTs inside an open distributed txn hit pinned
sessions. Optional --txn-log on sqlengine.
@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d884406f-472b-464d-ad15-9a5ddb77b05b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@renecannao
renecannao merged commit f1e896f into fix/shard-derived-sort-sql Aug 19, 2026
1 check 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.

1 participant