[
https://issues.apache.org/jira/browse/HBASE-19893?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16385751#comment-16385751
]
Toshihiro Suzuki edited comment on HBASE-19893 at 3/5/18 8:07 AM:
------------------------------------------------------------------
Thanks [~ram_krish].
{quote}
Why is that you need to add to the AM's in memory state from
RestoreSnapshotProcedure? Once the snapshot is restored will the AM
automatically read the META and do the assignments?
{quote}
As restore_snapshot is done offline, after finishing it, we need to enable the
target table. When enabling the table, EnableTableProcedure gets regions of the
table from AM and assigns them:
https://github.com/apache/hbase/blob/485af49e53cb38e2af4635f2c3bc0b33e15ba0a1/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/EnableTableProcedure.java#L123-L125
Therefore, I thought we needed to add region infos to AM in
RestoreSnapshotProcedure.
was (Author: brfrn169):
Thanks [~ram_krish].
{quote}
Why is that you need to add to the AM's in memory state from
RestoreSnapshotProcedure? Once the snapshot is restored will the AM
automatically read the META and do the assignments?
{quote}
As restore_snapshot is done offline, after finishing restore_snapshot, we need
to enable the target table. When enabling the table, EnableTableProcedure gets
regions of the table from AM and assign them:
https://github.com/apache/hbase/blob/485af49e53cb38e2af4635f2c3bc0b33e15ba0a1/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/EnableTableProcedure.java#L123-L125
Therefore, I thought we needed to add region infos to AM in
RestoreSnapshotProcedure.
> restore_snapshot is broken in master branch when region splits
> --------------------------------------------------------------
>
> Key: HBASE-19893
> URL: https://issues.apache.org/jira/browse/HBASE-19893
> Project: HBase
> Issue Type: Bug
> Components: snapshots
> Reporter: Toshihiro Suzuki
> Assignee: Toshihiro Suzuki
> Priority: Critical
> Attachments: HBASE-19893.master.001.patch,
> HBASE-19893.master.002.patch
>
>
> When I was investigating HBASE-19850, I found restore_snapshot didn't work in
> master branch.
>
> Steps to reproduce are as follows:
> 1. Create a table
> {code:java}
> create "test", "cf"
> {code}
> 2. Load data (2000 rows) to the table
> {code:java}
> (0...2000).each{|i| put "test", "row#{i}", "cf:col", "val"}
> {code}
> 3. Split the table
> {code:java}
> split "test"
> {code}
> 4. Take a snapshot
> {code:java}
> snapshot "test", "snap"
> {code}
> 5. Load more data (2000 rows) to the table and split the table agin
> {code:java}
> (2000...4000).each{|i| put "test", "row#{i}", "cf:col", "val"}
> split "test"
> {code}
> 6. Restore the table from the snapshot
> {code:java}
> disable "test"
> restore_snapshot "snap"
> enable "test"
> {code}
> 7. Scan the table
> {code:java}
> scan "test"
> {code}
> However, this scan returns only 244 rows (it should return 2000 rows) like
> the following:
> {code:java}
> hbase(main):038:0> scan "test"
> ROW COLUMN+CELL
> row78 column=cf:col, timestamp=1517298307049, value=val
> ....
> row999 column=cf:col, timestamp=1517298307608, value=val
> 244 row(s)
> Took 0.1500 seconds
> {code}
>
> Also, the restored table should have 2 online regions but it has 3 online
> regions.
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)