ksprojects / zkcopy

ZooKeeper copy utililty
Apache License 2.0
237 stars 94 forks source link

It must be clearly stated that this tool cannot copy sequential nodes with maintaining correct sequence number. #15

Open alexey-milovidov opened 6 years ago

alexey-milovidov commented 6 years ago

So, the next created sequential node won't get correct number.

kshchepanovskyi commented 6 years ago

Good point. What might be desired behavior?

alexey-milovidov commented 6 years ago

It's rather difficult to copy sequential nodes correctly.

One possible solution is to create and delete "fake" sequential nodes in multi transaction, while sequence number will become desired minus one; then create the final node.

This solution works, but it's rather tricky. For example, if sequence number was one million, you need to create and delete node 999 999 times. To speed up the process, you can do multiple create/delete in one transaction, for example, 100 operations in a batch. (Transaction can be arbitary large unless packet size is greater than 1 MB; and it's difficult to predict packet size.)