Refactor the data migration code
Search before asking
- [X] I had searched in the issues and found no similar issues.
Motivation
Now that we have support for DBIterator and WALIterator, we can refactor migration code based on redis-command using these two classes. Also, now that we support two different migration types, we can make the code base about migration a bit cleaner than it is now.
The unit tests could also be clearer.
Solution
No response
Are you willing to submit a PR?
- [ ] I'm willing to submit a PR!
Hi, i'm interested in this issue, could you please assign this to me?
@wsehjk Assigned. Go ahead :D
Based on my experience, you can share your opinion on this issue and how you'd like to implement it. If it's trivial, directly sending a patch is good.
Barely asking for an assignment without any thoughts or progress attempts often ends with giving up.
@caipengbo Would you mind giving some input about what you plan to improve?
@git-hulk This is my personal opinion for reference only:
- decouple the iteration logic from the send logic:
- use
DBIteratorandWALIteratorfor data iteration - use a
Senderhelper class for sending data and rate limit
- use
- Make the two migration types more uniform
- Refactor Golang unit tests about data migration to make them more concise and faster to run
- Other minor change:
MigrationJobstores what is really needed- ...
As @tisonkun said, you can also share some of your plans and we can discuss them together @wsehjk .
@caipengbo Thanks for your input.
@git-hulk This is my personal opinion for reference only:
decouple the iteration logic from the send logic:
- use
DBIteratorandWALIteratorfor data iteration- use a
Senderhelper class for sending data and rate limitMake the two migration types more uniform
Refactor Golang unit tests about data migration to make them more concise and faster to run
Other minor change:
MigrationJobstores what is really needed- ...
As @tisonkun said, you can also share some of your plans and we can discuss them together @wsehjk .
Thank you for the info, really helpful, and i will walk through the code and share my thought before developing