hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Feng Honghua (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-10595) HBaseAdmin.getTableDescriptor can wrongly get the previous table's TableDescriptor even after the table dir in hdfs is removed
Date Fri, 28 Feb 2014 08:00:26 GMT

    [ https://issues.apache.org/jira/browse/HBASE-10595?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13915541#comment-13915541
] 

Feng Honghua commented on HBASE-10595:
--------------------------------------

Thanks [~enis] for comment! sorry for the late reply
bq.Going to NN for checking whether table dir exists basically means that we should not be
using the cache at all. Users are expected to not delete the table directory from the file
system, which will cause further inconsistencies. Why do you think this is a problem?
# You meant HMaster when saying 'NN', right?
# In the time interval that after table dir is moved to tmp folder and before it's removed
from table descriptor cache, the results of listTables and getTableDescriptor contradict,
don't you think it's a kind of inconsistency?
# Users are surely NOT expected to delete table directory on purpose, but if they do delete
table directory by accident, we should still ensure queries on HBase states get consistent
results, right? Actually some HBCK unit tests aim for ensuring consistency under such corruption
from user.

> HBaseAdmin.getTableDescriptor can wrongly get the previous table's TableDescriptor even
after the table dir in hdfs is removed
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HBASE-10595
>                 URL: https://issues.apache.org/jira/browse/HBASE-10595
>             Project: HBase
>          Issue Type: Sub-task
>          Components: master, util
>            Reporter: Feng Honghua
>            Assignee: Feng Honghua
>         Attachments: HBASE-10595-trunk_v1.patch, HBASE-10595-trunk_v2.patch, HBASE-10595-trunk_v3.patch
>
>
> When a table dir (in hdfs) is removed(by outside), HMaster will still return the cached
TableDescriptor to client for getTableDescriptor request.
> On the contrary, HBaseAdmin.listTables() is handled correctly in current implementation,
for a table whose table dir in hdfs is removed by outside, getTableDescriptor can still retrieve
back a valid (old) table descriptor, while listTables says it doesn't exist, this is inconsistent
> The reason for this bug is because HMaster (via FSTableDescriptors) doesn't check if
the table dir exists for getTableDescriptor() request, (while it lists all existing table
dirs(not firstly respects cache) and returns accordingly for listTables() request)
> When a table is deleted via deleteTable, the cache will be cleared after the table dir
and tableInfo file is removed, listTables/getTableDescriptor inconsistency should be transient(though
still exists, when table dir is removed while cache is not cleared) and harder to expose



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Mime
View raw message