-
Notifications
You must be signed in to change notification settings - Fork 472
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid using Get interface to obtain metadata when iterating data during migration #906
Conversation
The problem we had was that when we migrated, we had a lot of disk reads, but with this optimized version, these abnormal disk reads disappeared, so I think GetMetaData calls the Get interface |
@datavisorxiaobiaozhao Yes. During the iteration, we set the cache not to be filled: so that when we call |
There may be some problem. The Get interface may aim to get the latest expire time of the key. |
@shangxiaoxiong Oh Yes, I missed that. Then we only need GetMetaData for those with expiration time. Or we can record the time snapshot was created and subtract the expiration time to determine whether it is expired! |
During sending snapshot, exipre time of some key may be changed to larger by clients. GetMetaData is needed to deal with this case. |
l think GetMetaData is needed for complex key with expire time to get the latest expire time. |
During sending snapshot:
|
Simple key is ok but complex key is not. |
It can't resolve this issue even we use the latest snapshot since the change may come after. |
Yeah. Using GetMetaData with latest snapshot can't solve the problem completely. Just a little improvement. |
Indeed, the whole process is not atomic. |
Yes, the root cause is the snapshot can be different between writers and background threads. I prefer to use current implementation, then we can try to seek another way to resolve this issue completely. How do you think? @caipengbo @shangxiaoxiong |
Current implementation makes slotmigration faster. Faster slotmigration is, smaller risk of losing key is. On the whole, current implementation may be good. |
I think OK, I will continue to think about how to solve this kind of problem. |
I think this is the best solution for now, merge this pr first, and then contionue to look for new solutions. |
Thanks all for the great discussion, I'll explain the problems with this implementation in #904 |
Fixed #904