[
https://issues.apache.org/jira/browse/HBASE-22417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16879319#comment-16879319
]
Wellington Chevreuil commented on HBASE-22417:
----------------------------------------------
Alright, had reviewed the previous build test failure and found out it was
actually legit. Issue was because:
1) I had moved *TRUNCATE_TABLE_CLEAR_FS_LAYOUT* to happen before
*TRUNCATE_TABLE_REMOVE_FROM_META.*
2) In *TRUNCATE_TABLE_CLEAR_FS_LAYOUT**,* we recreate table regions and assign
new list of regions to this
[_regions_|https://github.com/apache/hbase/blob/master/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/TruncateTableProcedure.java#L122]
global variable.
3) In *TRUNCATE_TABLE_REMOVE_FROM_META,* we pass the global _regions_ variable
to _DeleteTableProcedure.deleteFromMeta,_
[here|https://github.com/apache/hbase/blob/master/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/TruncateTableProcedure.java#L106],
but _regions_ variable does not contain original regions, because it got
already overridden with the new regions created on step #2 mentioned above. We
need to pass original list of regions to _DeleteTableProcedure.deleteFromMeta._
Attaching a new patch with the fix for above mentioned issue, together with
reported checkstyle issues correction.
> DeleteTableProcedure.deleteFromMeta method should remove table from Master's
> table descriptors cache
> ----------------------------------------------------------------------------------------------------
>
> Key: HBASE-22417
> URL: https://issues.apache.org/jira/browse/HBASE-22417
> Project: HBase
> Issue Type: Bug
> Reporter: Wellington Chevreuil
> Assignee: Wellington Chevreuil
> Priority: Major
> Attachments: HBASE-22417.master.001.patch,
> HBASE-22417.master.002.patch, HBASE-22417.master.003.patch,
> HBASE-22417.master.004.patch
>
>
> DeleteTableProcedure defines a static deleteFromMeta method that's currently
> used both by DeleteTableProcedure itself and TruncateTableProcedure.
> Sometimes, depending on the table size (and under slower, under performing
> FileSystems), truncation can take longer to complete
> *TRUNCATE_TABLE_CLEAR_FS_LAYOUT* stage, but the given table has already been
> deleted from meta on previous *TRUNCATE_TABLE_REMOVE_FROM_META* stage. In
> this case, features relying on Master's table descriptor's cache might
> wrongly try to reference this truncating table. Master Web UI, for example,
> would try to check this table state and end up showing a 500 error.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)