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

Himanshu Vashishtha commented on HBASE-9141:
--------------------------------------------

Thanks for the review Ted and JD.

bq. Any reason you went with System.out.println instead of LOG?
Its a tool, ought to run by an admin on a console. I thought it is appropriate 
to just print it on the console. (Also consistent with other tool such as 
HFileV1Detector, CompactionTool, SnapshotInfo, all use System.out.println.)

bq. initResources doesn't throw ZooKeeperConnectionException but it's listed.
This throws it
{code}
zkw = new ZooKeeperWatcher(getConf(), "ReplicationZnodesSnapshot",
        new ReplicationZnodesSnapshotAbortable());
{code}

bq. By default the tool should print the help if nothing is specified, right 
now it goes straight to initiating the resources for nothing.
The help option is with -h, --h, or --help. By default, it goes on to take a 
backup (So, it does "something" :) ). No strong opinion here, I could change it 
to just print help. Please let me know what you think.

bq. What happens right now if when doing recreate some znodes are already 
there? Should we move them aside or delete them?
If znode is there, it doesn't do anything. My idea of the usage of this tool is:
1) A user takes a backup.
2) On success message (grep for "SUCCESSFULLY SERIALIZED" in the o/p), deletes 
the current znodes.
3) Restore the znodes from the backup.
4) On success message (grep for "SUCCESSFULLY RESTORED" in the o/p), delete the 
backup file.

bq. Any chance of a unit test?
Hmm, that's a bit tricky I think. I would try to come up with one.

                
> Replication Znodes Backup Tool
> ------------------------------
>
>                 Key: HBASE-9141
>                 URL: https://issues.apache.org/jira/browse/HBASE-9141
>             Project: HBase
>          Issue Type: Improvement
>          Components: migration, Replication
>    Affects Versions: 0.94.10
>            Reporter: Himanshu Vashishtha
>            Assignee: Himanshu Vashishtha
>             Fix For: 0.95.2
>
>         Attachments: HBase-9141.patch
>
>
> While migrating to 0.96, we recommend deleting old znodes so users not face 
> issues like HBASE-7766, and let HBase create them out of box.
> Though HBase tends to store only ephemeral data in zookeeper, replication has 
> a different approach. Almost all of its data (state, peer info, logs, etc) is 
> present in zookeeper. We would like to preserve them in order to not do 
> re-adding of peers, and ensuring complete replication after we have migrated 
> to 0.96. 
> This jira adds a tool to serialize/de-serialize replication znodes to the 
> underlying filesystem. This could be used while migrating to 0.96.0.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to