mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-05 06:23:03 +00:00
The semaphore in question is used to limit parallelism of manipulations with table's sstables. It's currently used in two places -- sstable_directory (mainly on boot) and by table::take_snapshot() to take snapshot. For the latter, there's also a database -> sharded<directory_semaphore> reference. This PR sanitizes the semaphore usage. The results are - directory_semaphore no longer needs to friend several classes that mess with its internals - database no longer references directory_semaphore Closes scylladb/scylladb#18281 * github.com:scylladb/scylladb: database: Keep local directory_semaphore to initialize sstables managers database: Don't reference directory_semaphore table: Use directory semaphore from sstables manager table: Indentation fix after previous patch table: Use directory_semaphore for rate-limited snapshot taking sstables: Move directory_semaphore::parallel_for_each() to header sstables: Move parallel_for_each_restricted to directory_semaphore table: Use smp::all_cpus() to iterate over all CPUs locally