Oran Agra
b458b2999b
Fix LRU blue moon bug in RESTORE, RDB loading, module API ( #9279 )
...
The `lru_clock` and `lru` bits in `robj` save the least significant 24 bits of the unixtime (seconds since 1/1/1970),
and wrap around every 194 days.
The `objectSetLRUOrLFU` function, which is used in RESTORE with IDLETIME argument, and also in replica
or master loading an RDB that contains LRU, and by a module API had a bug that's triggered when that happens.
The scenario was that the idle time that came from the user, let's say RESTORE command is about 1000 seconds
(e.g. in the `RESTORE can set LRU` test we have), and the current `lru_clock` just wrapped around and is less than
1000 (i.e. a period of 1000 seconds once in some 6 months), the expression in that function would produce a negative
value and the code (and comment) specified that the best way to solve that is push the idle time backwards into the
past by 3 months. i.e. an idle time of 3 months instead of 1000 seconds.
instead, the right thing to do is to unwrap it, and put it near LRU_CLOCK_MAX. since now `lru_clock` is smaller than
`obj->lru` it will be unwrapped again by `estimateObjectIdleTime`.
bug was introduced by 052e03495f , but the code before it also seemed wrong.
2021-07-29 12:11:29 +03:00
..
2021-07-19 08:23:25 +03:00
2021-07-20 21:48:43 +03:00
2021-05-03 13:39:07 +03:00
2020-04-08 12:55:57 +02:00
2021-04-26 15:52:06 +03:00
2021-05-07 15:34:35 +03:00
2021-04-26 15:52:06 +03:00
2021-04-26 15:52:06 +03:00
2021-06-29 14:37:02 +03:00
2020-08-28 11:54:10 +03:00
2021-07-05 10:34:20 +03:00
2021-03-17 12:52:24 +02:00
2021-07-11 13:00:17 +03:00
2021-03-10 19:11:16 +02:00
2020-12-13 17:09:54 +02:00
2021-04-11 08:14:31 +03:00
2021-04-29 08:25:10 +03:00
2021-07-21 16:25:19 +03:00
2021-04-06 12:29:02 +03:00
2021-05-06 10:52:11 +03:00
2021-06-10 15:39:33 +03:00
2021-06-10 15:39:33 +03:00
2021-07-15 20:40:25 -07:00
2021-06-15 20:35:13 -07:00
2021-06-24 19:48:18 +03:00
2021-07-05 10:34:20 +03:00
2021-03-01 08:18:14 +02:00
2020-10-28 21:13:44 +02:00
2021-06-10 15:39:33 +03:00
2019-03-01 17:53:14 +01:00
2021-03-10 09:13:11 +02:00
2021-03-10 09:13:11 +02:00
2021-06-10 15:39:33 +03:00
2020-04-24 17:11:21 -07:00
2021-06-16 09:45:49 +03:00
2021-07-18 15:27:42 +03:00
2020-12-21 22:57:45 -08:00
2021-06-16 09:45:49 +03:00
2021-05-09 15:21:18 +03:00
2021-05-09 15:21:18 +03:00
2021-03-10 09:13:11 +02:00
2021-03-10 09:13:11 +02:00
2021-07-26 10:07:20 +03:00
2021-06-13 08:42:20 +03:00
2021-02-23 12:57:45 +02:00
2021-06-10 15:39:33 +03:00
2021-06-10 15:39:33 +03:00
2021-04-29 08:25:10 +03:00
2020-04-09 17:48:29 +08:00
2021-04-29 08:25:10 +03:00
2021-05-18 17:13:10 +03:00
2021-06-10 15:39:33 +03:00
2021-06-10 15:39:33 +03:00
2021-03-10 09:13:11 +02:00
2021-05-09 18:45:45 +03:00
2020-10-27 15:04:18 +02:00
2021-06-16 09:45:49 +03:00
2021-02-16 16:17:38 +02:00
2021-06-10 15:39:33 +03:00
2021-02-16 16:17:38 +02:00
2018-09-18 17:04:00 +08:00
2021-06-10 15:39:33 +03:00
2021-06-10 15:39:33 +03:00
2021-06-10 15:39:33 +03:00
2020-05-05 23:35:08 -04:00
2020-12-06 14:54:34 +02:00
2020-09-10 13:43:38 +03:00
2021-06-22 12:26:48 +03:00
2021-05-03 18:59:47 +03:00
2019-11-19 17:23:47 +08:00
2021-07-19 11:10:25 +03:00
2020-08-28 11:54:10 +03:00
2020-08-28 11:54:10 +03:00
2020-12-23 15:52:07 +02:00
2020-12-23 15:52:07 +02:00
2021-07-11 13:17:23 +03:00
2021-07-14 19:14:31 +03:00
2021-06-10 15:39:33 +03:00
2021-07-29 12:11:29 +03:00
2021-06-15 20:35:13 -07:00
2021-05-10 14:02:25 +03:00
2021-05-10 14:02:25 +03:00
2017-03-27 16:37:22 +02:00
2021-06-30 08:21:19 +03:00
2020-09-10 13:43:38 +03:00
2021-07-06 08:21:17 +03:00
2021-06-16 09:45:49 +03:00
2021-06-24 18:04:19 +03:00
2021-04-20 21:51:24 +03:00
2021-06-16 09:45:49 +03:00
2021-07-15 16:01:11 -07:00
2018-07-13 10:51:58 +02:00
2021-04-26 15:52:06 +03:00
2020-12-06 14:54:34 +02:00
2021-06-16 09:45:49 +03:00
2019-10-02 11:30:20 +02:00
2021-07-06 10:46:10 +03:00
2021-06-10 15:39:33 +03:00
2019-10-07 21:06:30 +03:00
2021-07-18 14:11:09 +03:00
2021-07-05 09:30:16 +03:00
2021-07-05 09:30:16 +03:00
2020-12-06 14:54:34 +02:00
2021-06-24 19:48:18 +03:00
2021-07-26 10:07:20 +03:00
2021-07-26 10:07:20 +03:00
2020-10-25 14:14:05 +02:00
2021-02-23 12:57:45 +02:00
2021-03-10 09:13:11 +02:00
2021-03-10 09:13:11 +02:00
2019-09-12 12:21:37 +02:00
2021-07-10 10:04:54 -05:00
2020-09-10 13:43:38 +03:00
2021-06-14 16:46:45 +03:00
2019-12-02 00:28:41 -05:00
2021-06-10 15:39:33 +03:00
2020-09-10 13:43:38 +03:00
2021-06-10 15:39:33 +03:00
2021-07-05 10:41:57 +03:00
2021-04-27 14:25:02 +03:00
2021-07-17 09:54:06 +03:00
2021-07-13 18:16:05 +03:00
2021-07-03 10:51:53 -05:00
2021-07-22 13:40:00 +03:00
2020-12-21 22:57:45 -08:00
2020-07-21 08:13:05 +03:00
2021-07-14 12:32:13 +03:00
2021-06-22 07:35:59 +03:00
2021-03-10 09:13:11 +02:00
2021-06-10 15:39:33 +03:00
2020-12-06 14:54:34 +02:00
2020-10-11 17:21:58 +03:00
2021-07-11 11:26:31 +03:00
2021-03-10 09:13:11 +02:00
2021-06-10 15:39:33 +03:00
2021-03-10 09:13:11 +02:00
2021-03-22 13:25:58 +02:00
2021-03-10 09:13:11 +02:00