Peter Dillinger
cad809978a
Fix heap use-after-free race with DropColumnFamily ( #9730 )
...
Summary:
Although ColumnFamilySet comments say that DB mutex can be
freed during iteration, as long as you hold a ref while releasing DB
mutex, this is not quite true because UnrefAndTryDelete might delete cfd
right before it is needed to get ->next_ for the next iteration of the
loop.
This change solves the problem by making a wrapper class that makes such
iteration easier while handling the tricky details of UnrefAndTryDelete
on the previous cfd only after getting next_ in operator++.
FreeDeadColumnFamilies should already have been obsolete; this removes
it for good. Similarly, ColumnFamilySet::iterator doesn't need to check
for cfd with 0 refs, because those are immediately deleted.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/9730
Test Plan:
was reported with ASAN on unit tests like
DBLogicalBlockSizeCacheTest.CreateColumnFamily (very rare); keep watching
Reviewed By: ltamasi
Differential Revision: D35038143
Pulled By: pdillinger
fbshipit-source-id: 0a5478d5be96c135343a00603711b7df43ae19c9
2022-03-24 13:05:17 -07:00
..
2022-02-16 23:18:14 -08:00
2022-03-21 16:11:02 -07:00
2022-03-24 13:05:17 -07:00
2022-03-15 09:50:21 -07:00
2021-09-29 04:04:40 -07:00
2022-03-15 14:45:34 -07:00
2021-09-16 17:23:36 -07:00
2022-03-21 12:04:33 -07:00
2022-03-23 10:00:54 -07:00
2021-12-10 08:13:26 -08:00
2022-03-24 13:05:17 -07:00
2022-03-24 13:05:17 -07:00
2022-02-22 12:23:00 -08:00
2021-12-10 08:13:26 -08:00
2022-02-16 23:18:14 -08:00
2022-01-04 16:45:49 -08:00
2021-10-18 23:32:01 -07:00
2022-02-17 16:31:41 -08:00
2022-02-04 14:15:58 -08:00
2022-03-23 10:00:54 -07:00
2021-07-23 08:38:45 -07:00
2022-03-15 12:31:14 -07:00
2022-01-27 13:01:09 -08:00
2021-07-23 08:38:45 -07:00
2022-03-24 13:05:17 -07:00
2022-03-10 15:16:55 -08:00
2021-07-30 12:16:44 -07:00
2020-06-15 10:47:02 -07:00
2022-03-21 12:04:33 -07:00
2021-11-08 11:05:59 -08:00
2021-05-05 14:00:17 -07:00
2022-01-28 13:28:38 -08:00
2022-01-28 13:28:38 -08:00
2021-09-29 04:04:40 -07:00
2021-07-23 08:38:45 -07:00
2022-02-01 22:19:01 -08:00
2021-08-10 11:10:07 -07:00
2022-03-04 11:35:28 -08:00
2021-07-23 08:38:45 -07:00
2022-02-15 12:25:18 -08:00
2021-07-23 08:38:45 -07:00
2022-02-08 19:31:28 -08:00
2022-03-07 18:06:19 -08:00
2022-03-15 09:50:21 -07:00
2022-03-08 13:19:39 -08:00
2022-01-04 16:45:49 -08:00
2022-01-04 16:45:49 -08:00
2021-09-07 13:28:29 -07:00
2021-11-19 17:31:01 -08:00
2021-07-23 08:38:45 -07:00
2022-03-18 16:35:51 -07:00
2022-02-09 12:36:43 -08:00
2022-03-22 10:22:18 -07:00
2022-02-03 15:15:23 -08:00
2021-11-18 17:31:50 -08:00
2022-03-23 19:41:31 -07:00
2022-03-11 16:13:23 -08:00
2022-02-08 12:15:35 -08:00
2021-11-08 11:05:59 -08:00
2021-11-08 11:05:59 -08:00
2021-11-08 11:05:59 -08:00
2021-11-10 10:49:04 -08:00
2022-03-11 16:13:23 -08:00
2021-11-08 11:05:59 -08:00
2022-03-15 14:45:34 -07:00
2022-03-15 14:45:34 -07:00
2022-03-15 14:45:34 -07:00
2022-03-23 19:41:31 -07:00
2021-12-08 14:30:57 -08:00
2022-03-18 16:35:51 -07:00
2021-11-08 11:05:59 -08:00
2022-03-02 17:41:02 -08:00
2021-12-16 17:15:13 -08:00
2022-01-04 16:45:49 -08:00
2021-12-13 09:00:36 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-10-28 23:22:27 -07:00
2022-02-08 12:15:35 -08:00
2022-03-21 16:11:02 -07:00
2022-03-15 14:45:34 -07:00
2020-02-20 12:09:57 -08:00
2021-03-19 12:09:47 -07:00
2022-01-12 09:31:12 -08:00
2022-01-21 11:37:46 -08:00
2022-01-21 11:37:46 -08:00
2022-03-11 16:13:23 -08:00
2022-02-18 18:23:07 -08:00
2021-12-16 17:15:13 -08:00
2021-07-23 08:38:45 -07:00
2022-03-18 16:35:51 -07:00
2021-10-20 13:17:00 -07:00
2022-03-18 16:35:51 -07:00
2021-11-16 10:20:50 -08:00
2022-02-22 12:23:00 -08:00
2022-02-17 16:19:31 -08:00
2022-03-09 15:49:53 -08:00
2022-03-09 15:49:53 -08:00
2022-03-09 15:49:53 -08:00
2022-03-09 15:49:53 -08:00
2022-03-09 15:49:53 -08:00
2020-02-20 12:09:57 -08:00
2021-03-19 12:09:47 -07:00
2021-09-29 04:04:40 -07:00
2021-09-07 11:31:59 -07:00
2020-02-20 12:09:57 -08:00
2022-01-12 09:31:12 -08:00
2022-03-15 14:45:34 -07:00
2022-03-23 19:41:31 -07:00
2022-03-15 14:45:34 -07:00
2022-01-27 14:55:04 -08:00
2022-01-27 14:55:04 -08:00
2021-05-10 12:50:25 -07:00
2021-11-19 17:53:47 -08:00
2021-11-19 17:53:47 -08:00
2021-11-19 17:53:47 -08:00
2020-02-20 12:09:57 -08:00
2022-01-04 16:45:49 -08:00
2021-12-10 11:05:35 -08:00
2020-12-23 16:55:53 -08:00
2021-09-29 04:04:40 -07:00
2021-09-29 04:04:40 -07:00
2021-03-15 04:34:11 -07:00
2021-07-23 08:38:45 -07:00
2022-03-12 11:45:56 -08:00
2022-03-12 11:45:56 -08:00
2021-09-07 11:31:59 -07:00
2022-01-21 11:37:46 -08:00
2021-09-10 10:00:26 -07:00
2021-03-15 04:34:11 -07:00
2021-10-06 07:48:31 -07:00
2021-10-06 07:48:31 -07:00
2020-10-28 10:12:58 -07:00
2021-03-25 21:18:08 -07:00
2021-10-06 07:48:31 -07:00
2021-06-18 04:57:27 -07:00
2021-06-18 04:57:27 -07:00
2021-09-10 10:00:26 -07:00
2021-07-28 16:44:14 -07:00
2022-01-21 11:37:46 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2021-09-10 10:00:26 -07:00
2022-03-15 09:55:49 -07:00
2022-01-21 11:37:46 -08:00
2021-11-18 11:43:44 -08:00
2021-03-25 15:00:45 -07:00
2021-11-19 11:37:06 -08:00
2021-12-10 11:05:35 -08:00
2021-09-29 04:04:40 -07:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2022-02-09 12:36:43 -08:00
2022-02-09 12:36:43 -08:00
2022-01-21 11:37:46 -08:00
2022-03-23 19:41:31 -07:00
2021-06-10 12:55:20 -07:00
2021-12-03 14:43:14 -08:00
2021-11-22 09:30:47 -08:00
2022-02-04 08:19:20 -08:00
2022-03-23 19:41:31 -07:00
2022-03-23 19:41:31 -07:00
2022-03-24 13:05:17 -07:00
2022-03-18 16:35:51 -07:00
2020-12-09 16:02:12 -08:00
2020-12-09 16:02:12 -08:00
2020-12-09 16:02:12 -08:00
2021-09-21 09:23:48 -07:00
2021-07-30 12:16:44 -07:00
2021-07-30 12:16:44 -07:00
2020-02-20 12:09:57 -08:00
2022-02-22 14:23:01 -08:00
2022-02-22 14:23:01 -08:00
2022-03-16 19:00:04 -07:00
2021-07-07 11:14:05 -07:00
2020-02-20 12:09:57 -08:00
2021-03-18 09:47:31 -07:00
2021-03-18 09:47:31 -07:00
2021-03-18 09:47:31 -07:00
2022-03-08 13:19:39 -08:00
2022-03-08 13:19:39 -08:00