Repository navigation
fix(eloq): parse a temporary table's node id in hex - #254
Open
liangjchen wants to merge 1 commit into
Open
liangjchen wants to merge 1 commit into
liangjchen wants to merge 1 commit into
Conversation
build_tmptable_filename() appends the creating node's id to a temporary table's name in hex (%x), but is_tmp_table_of() parsed it back in decimal. Ids 0 to 9 agree; from 10 on they name another node: node 10 writes "a", which parses as 0, so node 0's drop_orphan_tmp_tables() at startup dropped node 10's live temporary tables, and node 10 never dropped its own orphans. is_tmp_table_of() now parses the id in hex, matching the writer and the names existing servers have already written. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
A temporary table's name ends with the id of the node that created it, so that after a crash the node can drop its own orphans at its next start (
drop_orphan_tmp_tables()inha_eloq.cc).build_tmptable_filename()writes that id in hex (%x), butis_tmp_table_of()instorage/eloq/eloq_catalog_name.hparsed it back in decimal (strtoul(..., 10)).Ids 0 to 9 agree. From 10 on they name another node:
a, which parses as 0, so node 0's next start drops node 10's live temporary tables;10, which node 10 takes for its own.is_tmp_table_of()now parses the id in hex, as it is written.How can this PR be tested?
The regex and the function body were checked in a standalone program against names produced with
build_tmptable_filename()'s format, for every owner and node id from 0 to 300:An end-to-end check needs a cluster with a node id of 10 or more: create a temporary table on that node, kill it, and restart node 0 and then that node. Node 0 must leave the table alone, and the owner must drop it.
Backward compatibility
No format change: names already written are hex, and they are now read the same way. After the upgrade, a node stops dropping other nodes' temporary tables and starts dropping its own orphans.
🤖 Generated with Claude Code