-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
report dirty metadata in meta table #81
base: master
Are you sure you want to change the base?
Conversation
💔 -1 overall
This message was automatically generated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for submitting this PR, @Mengqi777 ! I have a few remarks made on part of the code. Additional to those, please add UTs for each of the added methods.
Also, we need to add description for this new command at hbck2 README.md.
@@ -263,6 +259,39 @@ public static void addRegionToMeta(Connection conn, RegionInfo region) throws IO | |||
}); | |||
} | |||
|
|||
|
|||
/** | |||
* List all dirty metadata currently in META. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's explain properly what "dirty" means in this context.
Scan scan = new Scan(); | ||
ResultScanner resultScanner = metaTable.getScanner(scan); | ||
for (Result result : resultScanner) { | ||
result.listCells().forEach(cell -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need to iterate through each cell? It seems you only care about the row key, so no need to go through every single cell of each row.
@@ -100,6 +102,7 @@ | |||
private static final String SET_REGION_STATE = "setRegionState"; | |||
private static final String SCHEDULE_RECOVERIES = "scheduleRecoveries"; | |||
private static final String GENERATE_TABLE_INFO = "generateMissingTableDescriptorFile"; | |||
private static final String REPORT_DIRTY_METADATA = "reportDirtyMetadata"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's give this command a more intuitive name. What's dirtyMetadata?
writer.println(" Options:"); | ||
writer.println(" -f, --fix fix meta by delete all dirty metadata found."); | ||
writer.println(" Looks for undeleted metadata in meta table. "); | ||
writer.println(" Undeleted metadata means a table has been deleted, but not delete all metadata in meta."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we describe here in more details an example scenario where this command would be useful? See, for example, the explanation for reportMissingRegionsInMeta
.
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
@wchevreuil hi bro, thanks for your suggestion, I have change the name to reportundeletedregionsinmeta and add the UTs, PTAL. |
💔 -1 overall
This message was automatically generated. |
Our cluster has experienced such problems: a table has been deleted but meta table still storage metadata about this table, thoese metadata show in hbck ui until I delete them.