HBASE-21214 [hbck2] setTableState just sets hbase:meta state, not in-memory state

This commit is contained in:
Michael Stack 2018-09-20 12:08:10 -07:00
parent 1010992ee8
commit 98909f4a9d
No known key found for this signature in database
GPG Key ID: 9816C7FC8ACC93D2
1 changed files with 3 additions and 4 deletions

View File

@ -2329,12 +2329,11 @@ public class MasterRpcServices extends RSRpcServices
@Override @Override
public GetTableStateResponse setTableStateInMeta(RpcController controller, public GetTableStateResponse setTableStateInMeta(RpcController controller,
SetTableStateInMetaRequest request) throws ServiceException { SetTableStateInMetaRequest request) throws ServiceException {
Connection conn = master.getConnection();
TableName tn = ProtobufUtil.toTableName(request.getTableName()); TableName tn = ProtobufUtil.toTableName(request.getTableName());
try { try {
HBaseProtos.TableState prevState = MetaTableAccessor.getTableState(conn, tn).convert(); HBaseProtos.TableState prevState =
MetaTableAccessor.updateTableState(conn, tn, this.master.getTableStateManager().getTableState(tn).convert();
this.master.getTableStateManager().setTableState(tn,
TableState.convert(tn, request.getTableState()).getState()); TableState.convert(tn, request.getTableState()).getState());
return GetTableStateResponse.newBuilder().setTableState(prevState).build(); return GetTableStateResponse.newBuilder().setTableState(prevState).build();
} catch (Exception e) { } catch (Exception e) {