[Bug] The 2026-08-17 table renames have no upgrade path, and two deploy scripts still target the dropped names
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 85/100
Research direction
Start from deploy/mysql/upgrade-instance-id-pk.sql and deploy/mysql/upgrade-query-history-context.sql. Compare the table names they reference against server/src/main/resources/db/schema.sql to confirm the renames from #2317. Either add IF EXISTS guards so the scripts skip on current schemas, or create a new migration that renames the four old tables to their new names before these scripts run. Run the scripts against a test database initialized from schema.sql to verify they no longer error.
Written by the indexing model from the issue text.
Description
Before Creating the Bug Report
- I have searched the open issues of this repository and believe that this is not a duplicate.
- This is a defect in RocketMQ Studio, not a usage question and not a defect in another Apache RocketMQ repository.
- I can reproduce this on the current
masterbranch, or I have stated the exact version I am running below.
Studio Version
branch: rocketmq-studio
git commit id: 6a68042f
deployed as: docker compose (deploy/docker-compose.yml, existing MySQL volume)
Runtime Environment
OS: Ubuntu 22.04 (WSL2) — no local Docker integration, so the scripts could not be executed here; the failure mode below is read off the guards and MySQL's documented behaviour for a missing table
MySQL: 8.0 (the compose service)
browser: not applicable
Connected RocketMQ Cluster
RocketMQ version: not applicable — the defect is in the MySQL upgrade scripts
access mode: not applicable
deployment: not applicable
Describe the Bug
Two files under deploy/mysql/ still address tables that #2317 renamed on 2026-08-17, and nothing in the repository ever migrates the rename for an existing volume:
upgrade-instance-id-pk.sql(added 2026-08-13, untouched since) updatesrmq_topic,rmq_group,rmq_acl_rule,rmq_acl_user,rmq_data_source,rmq_instance; the first two were renamed tormq_instance_topic/rmq_instance_groupby #2317.upgrade-query-history-context.sql(added 2026-08-07, untouched since) altersrmq_message_queryandrmq_trace_query, renamed tormq_instance_message/rmq_instance_traceby the same commit.grep -rn "RENAME TABLE" .finds nothing, anddeploy/mysql/contains no script that bridges the old names to the new ones, so a volume created before 2026-08-17 never gets them.
Two consequences, both of them wrong:
- On any database created or upgraded after #2317 (which is every deployment from the current branch), running these scripts aborts. Their guards probe a column or an index on the old table rather than the table itself, so an absent table reads as "needs the change":
SET @message_query_column_exists := (SELECT COUNT(*) FROM information_schema.columns
WHERE table_schema = @schema_name AND table_name = 'rmq_message_query' AND column_name = 'cluster_id');
SET @message_query_sql := IF(@message_query_column_exists = 0,
'ALTER TABLE rmq_message_query ADD COLUMN cluster_id VARCHAR(255) AFTER result_count', 'SELECT 1');
count = 0 → ALTER TABLE rmq_message_query … → ERROR 1146 (42S02): Table 'rocketmq.rmq_message_query' doesn't exist, and the mysql client stops at the first error in batch mode. upgrade-instance-id-pk.sql has no guard at all, so it fails on its very first UPDATE rmq_topic t JOIN ….
- On a volume that still has the old tables, the scripts run, but every statement that touches a renamed table lands in a table the application no longer reads (
RmqMessageQuerymaps tormq_instance_message,RmqTraceQuerytormq_instance_trace), so the migration reports success without bringing the deployment closer to the current schema — only the parts that touch surviving tables (such asrmq_instance.id) take effect.
The scripts tell operators to run them ("存量 MySQL 数据卷增量迁移", "Run once on existing deployments"), and the project has already fixed this exact class of defect once: #4722 ("The nameserver unique-key migration script references a dropped column and always aborts") was fixed by #4721.
Steps to Reproduce
- On a database initialized from
server/src/main/resources/db/schema.sql(the authoritative DDL), list the tables:rmq_topic,rmq_group,rmq_message_queryandrmq_trace_querydo not exist;rmq_instance_topic,rmq_instance_group,rmq_instance_messageandrmq_instance_tracedo. - Run
mysql -uroot -p rocketmq < deploy/mysql/upgrade-query-history-context.sql: the preparedALTER TABLE rmq_message_query …fails with error 1146. - Run
mysql -uroot -p rocketmq < deploy/mysql/upgrade-instance-id-pk.sql: the first statement fails with error 1146 onrmq_topic. - Check
git log -S "rmq_message_query" -- server/src/main/resources/db/schema.sqland the #2317 commit message: the rename is the source of the mismatch, and no script renames anything.
What Did You Expect to See?
Either the scripts work on the schema they claim to upgrade, or they say plainly that the deployment is outside the supported upgrade path — instead of failing with a raw driver error halfway through, or silently writing to tables nobody reads.
What Did You See Instead?
Two scripts that cannot succeed on a current database, no migration for the #2317 renames at all, and no statement anywhere that pre-#2317 volumes are unsupported.
Additional Context
- I am happy to implement whichever direction maintainers pick: (a) add the missing rename migration (rename the four tables in the right order, then let the existing scripts run against the current names), or (b) declare pre-#2317 volumes unsupported and make it explicit — for example guard the two scripts on table existence so they skip with a message, and update their headers and
deploy/README.md, which currently only mentions the demo scripts. - What cannot stay as it is: a "run this on existing deployments" instruction that aborts with
1146, and a rename with no migration behind it. - duplicate check: searched open/recent issues and PRs for
rmq_message_query, "upgrade script", "existing volume" and "table rename"; the only related item is the closed #4722/#4721 pair for the nameserver script.
Are You Willing to Submit a Pull Request?
- Yes, I am willing to submit a pull request.
- Dominant language
- Java
- Stars
- 1.4k
- Forks
- 718
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 215
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/rocketmq-dashboard
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/rocketmq-dashboard#5644 · 1 comment ·
Maintainers usually reply within 3 days
-
[Bug] DLQ timestamps shift with the JVM zone while every other zoneless datetime is UTCPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
apache/rocketmq-dashboard#5587 · 1 comment ·
Maintainers usually reply within 3 days
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 47/100
apache/rocketmq-dashboard#7398 ·
Maintainers usually reply within 3 days
-
[Feature]Openenhancement
Difficulty 5/5 Over a week Newbie friendliness 8/100
apache/rocketmq-dashboard#7376 ·
Maintainers usually reply within 3 days
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 12/100
apache/rocketmq-dashboard#6027 · 1 comment ·
Maintainers usually reply within 3 days
All issues in apache/rocketmq-dashboard
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
NationalSecurityAgency/ghidra#10155 ·
Maintainers usually reply within 2 days
-
bug web-ui
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
jenkinsci/jenkins#27705 · 3 comments ·
Maintainers usually reply within 1 day
-
mod bug
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
elmital/FixMCStats#65 · 3 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
googleads/googleads-mobile-flutter#1541 ·
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Julow/Unexpected-Keyboard#1490 ·
Maintainers usually reply within 4 days