Shadow
The Shadow MCP feature plugin helps users plan, review, apply, and validate shadow rules, default shadow algorithms, and safe cleanup of unused shadow algorithms. It generates shadow rule DistSQL only. It does not create shadow databases or physical tables, and it does not generate physical DDL, index DDL, migration, backfill, data probes, physical metadata probes, or storage unit mutation tasks.
Prerequisites
- The target
runtimeDatabasesentry should connect to ShardingSphere-Proxy. - Source and shadow storage units must already exist.
- Cleanup planning reads Proxy-visible rule, table-rule, default-algorithm, and configured-algorithm state before generating
DROP SHADOW ALGORITHM.
Natural language examples
- List configured shadow rules and shadow algorithm plugins in
logic_db. - Plan a shadow rule for table
t_orderusing source storage unitds_0, shadow storage unitds_shadow, and a column-match algorithm. - Drop unused shadow algorithm
shadow_by_user_idonly if Proxy-visible state proves it is unused.
Review checklist
- Confirm that rule plans use shadow DistSQL and reference existing storage units.
- Confirm that default algorithm plans update only the default shadow algorithm.
- Review
algorithm_recommendationsbefore selecting a shadow algorithm.SQL_HINThas no required properties. VALUE_MATCHrequiresoperation,column, andvalue;REGEX_MATCHrequiresoperation,column, andregex.- Confirm cleanup plans include evidence that the target algorithm is unused.
- Confirm the returned
plan_id,resources_to_read,next_actions, anddistsql_artifactsbefore applying the workflow.
For the general review flow of rule changes, see Rule Change Flow.
Limitations
- Supports ShardingSphere-Proxy logical databases only.
- Does not create shadow databases, physical tables, or storage units.
- Cleanup is limited to DistSQL-visible unused shadow algorithms.
- Object name content must not contain backticks, NUL, carriage returns, or line feeds.