You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by GitBox <gi...@apache.org> on 2022/10/24 11:25:42 UTC
[GitHub] [incubator-kvrocks] mapleFU commented on issue #983: Flaky test on expire precision
mapleFU commented on issue #983:
URL: https://github.com/apache/incubator-kvrocks/issues/983#issuecomment-1288892260
There are multiple `time` calling in kvrocks:
1. `std::time`, which is from c's api, setting the backup_time and checkpoint access time
2. `rocksdb::Env::GetCurrentTime`, which also calls `std::time` on posix
3. `gettimeofday` in `Worker::FeedMonitorConns`
Notes that:
1. `gettimeofday` is not monotonic, and can be updated by system: https://man7.org/linux/man-pages/man2/gettimeofday.2.html
2. std::time: https://en.cppreference.com/w/cpp/chrono/c/time
As for golang, after 1. Seems it uses monotonic clock ( https://pkg.go.dev/time#hdr-Monotonic_Clocks ). C++11 also provides monotonic clock: https://en.cppreference.com/w/cpp/chrono/steady_clock
In redis, I found an issue and the solving, maybe we could follow it: https://github.com/redis/redis/issues/416
At least, keep 3 or more `time` in kvrocks is really confusing.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org