Michał Chojnowski
4a18a08284
utils/lsa/chunked_managed_vector: fix the calculation of max_chunk_capacity()
...
`chunked_managed_vector` is a vector-like container which splits
its contents into multiple contiguous allocations if necessary,
in order to fit within LSA's max preferred contiguous allocation
limits.
Each limited-size chunk is stored in a `managed_vector`.
`managed_vector` is unaware of LSA's size limits.
It's up to the user of `managed_vector` to pick a size which
is small enough.
This happens in `chunked_managed_vector::max_chunk_capacity()`.
But the calculation is wrong, because it doesn't account for
the fact that `managed_vector` has to place some metadata
(the backreference pointer) inside the allocation.
In effect, the chunks allocated by `chunked_managed_vector`
are just a tiny bit larger than the limit, and the limit is violated.
Fix this by accounting for the metadata.
Also, before the patch `chunked_managed_vector::max_contiguous_allocation`,
repeats the definition of logalloc::max_managed_object_size.
This is begging for a bug if `logalloc::max_managed_object_size`
changes one day. Adjust it so that `chunked_managed_vector` looks
directly at `logalloc::max_managed_object_size`, as it means to.
Fixes scylladb/scylladb#23854
(cherry picked from commit 7f9152babc )
Closes scylladb/scylladb#24369
2025-06-03 18:10:36 +03:00
..
2023-09-11 14:38:46 +03:00
2022-11-17 11:09:59 +02:00
2025-06-03 18:10:36 +03:00
2024-09-12 18:38:16 +03:00
2024-07-08 16:08:27 +02:00
2024-01-18 12:50:06 +02:00
2022-01-18 12:15:18 +01:00
2023-12-02 22:37:22 +02:00
2023-12-02 22:37:22 +02:00
2024-08-05 08:23:35 +03:00
2023-09-04 16:14:38 +03:00
2024-09-11 23:21:40 +03:00
2024-01-18 12:50:06 +02:00
2022-01-18 12:15:18 +01:00
2024-09-11 23:21:40 +03:00
2024-04-19 07:44:07 +03:00
2023-12-12 21:09:51 +08:00
2024-08-05 08:23:35 +03:00
2024-06-24 12:06:01 +05:30
2024-06-24 12:06:01 +05:30
2022-01-18 12:15:18 +01:00
2024-08-05 08:23:35 +03:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2023-05-07 17:17:34 +03:00
2024-08-05 08:23:35 +03:00
2023-09-01 22:34:41 +02:00
2024-12-09 23:18:00 +01:00
2024-06-25 12:08:06 +03:00
2024-01-31 16:45:09 +02:00
2024-08-05 08:23:35 +03:00
2024-08-05 08:23:35 +03:00
2024-07-18 18:38:22 +03:00
2024-06-27 19:36:13 +03:00
2024-09-11 23:21:40 +03:00
2024-10-01 01:38:47 +00:00
2024-01-18 12:50:06 +02:00
2024-01-18 12:50:06 +02:00
2024-08-05 08:23:35 +03:00
2022-01-18 12:15:18 +01:00
2023-12-20 10:25:03 +02:00
2024-05-18 00:24:00 +03:00
2024-05-18 00:24:00 +03:00
2024-04-19 22:56:16 +08:00
2024-02-01 12:20:23 +05:30
2024-08-11 13:52:35 +03:00
2024-05-26 16:45:42 +03:00
2024-08-04 15:32:01 +03:00
2024-08-05 08:23:35 +03:00
2022-07-27 13:32:36 +03:00
2022-07-27 13:32:36 +03:00
2024-08-05 08:23:35 +03:00
2024-07-10 20:39:01 +03:00
2022-01-18 12:15:18 +01:00
2025-04-10 07:33:09 -04:00
2024-08-05 08:23:35 +03:00
2024-04-19 07:44:07 +03:00
2024-01-18 12:50:06 +02:00
2024-02-01 14:50:17 +02:00
2024-05-26 16:45:42 +03:00
2024-08-05 08:23:35 +03:00
2024-02-02 15:20:40 +01:00
2024-08-05 08:23:35 +03:00
2022-01-18 12:15:18 +01:00
2024-04-19 07:44:07 +03:00
2024-10-01 01:38:47 +00:00
2022-01-18 12:15:18 +01:00
2023-04-24 14:06:43 +03:00
2023-04-24 14:06:40 +03:00
2024-05-27 17:34:38 +03:00
2024-01-23 13:12:34 +02:00
2024-08-22 23:34:24 +03:00
2024-07-09 18:31:35 +03:00
2024-03-12 14:53:55 +08:00
2024-04-19 07:44:07 +03:00
2024-08-05 08:23:35 +03:00
2024-06-24 12:06:01 +05:30
2022-03-25 16:19:26 +02:00
2022-01-18 12:15:18 +01:00
2024-08-05 08:23:35 +03:00
2024-08-05 08:23:35 +03:00
2024-08-05 08:23:35 +03:00
2024-08-05 08:23:35 +03:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2024-09-11 23:21:40 +03:00
2024-09-05 11:10:21 +03:00
2025-05-06 10:19:32 +02:00
2024-08-05 08:23:35 +03:00
2025-06-03 18:10:36 +03:00
2025-06-03 18:10:36 +03:00
2024-08-05 08:23:35 +03:00
2024-02-23 11:32:41 +08:00
2025-04-18 07:55:23 +00:00
2022-02-24 19:44:50 +03:00
2025-06-03 18:10:36 +03:00
2022-01-18 12:15:18 +01:00
2024-07-04 10:07:48 +03:00
2023-12-02 22:37:22 +02:00
2022-01-18 12:15:18 +01:00
2024-06-24 08:24:43 +03:00
2024-06-24 08:24:43 +03:00
2024-02-09 17:00:33 +01:00
2022-11-28 21:58:30 +02:00
2024-01-31 16:45:09 +02:00
2024-08-05 08:23:35 +03:00
2022-01-18 12:15:18 +01:00
2024-02-07 18:31:28 +01:00
2024-08-05 08:23:35 +03:00
2024-01-31 09:16:10 +02:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2023-12-02 22:37:22 +02:00
2023-02-03 19:04:32 +01:00
2022-02-22 16:25:21 +01:00
2024-02-02 22:12:57 +08:00
2024-08-05 08:23:35 +03:00
2022-03-16 12:28:47 +03:00
2024-08-05 08:23:35 +03:00
2024-09-12 15:22:49 +03:00
2024-10-09 21:50:26 +03:00
2023-06-26 11:10:38 +03:00
2022-01-18 12:15:18 +01:00
2022-01-18 12:15:18 +01:00
2023-05-21 11:33:38 +04:00
2024-01-18 12:50:06 +02:00
2023-05-11 16:31:23 +03:00
2023-04-24 14:06:43 +03:00
2024-04-19 22:57:36 +08:00
2024-08-08 10:42:09 +02:00
2024-06-18 23:36:30 +05:30
2022-05-13 07:11:58 +02:00
2024-08-15 02:12:58 +02:00
2024-08-05 08:23:35 +03:00
2024-08-19 17:20:12 +03:00
2024-04-23 12:09:05 +03:00
2024-08-05 08:23:35 +03:00
2023-06-15 15:52:50 +04:00
2023-01-27 19:15:39 +01:00
2022-01-18 12:15:18 +01:00
2023-12-02 22:37:22 +02:00
2024-08-19 17:20:12 +03:00
2023-12-02 22:37:22 +02:00
2022-01-18 12:15:18 +01:00
2024-04-30 09:07:22 +03:00
2024-12-04 14:18:16 +01:00
2024-09-11 23:21:40 +03:00
2024-08-05 08:23:35 +03:00
2024-08-13 10:02:43 +02:00
2022-11-27 16:34:34 +02:00
2022-01-18 12:15:18 +01:00
2024-05-18 00:24:00 +03:00