vinyl: remove dependency of scheduler on environment
Instead of storing a pointer to vy_env in vy_scheduler, let's: - Add pointers to tx_manager::read_views and vy_env::run_env to vy_scheduler struct. They are needed to create a write iterator for a dump/compaction task. - Add a callback to struct vy_scheduler that is called upon dump completion to free memory. This allows us to eliminate accesses vy_env::quota and vy_env::allocator from vy_scheduler code. - Move the assert that assures that the scheduler isn't started during local recovery from vy_scheduler_f() to vy_env_quota_exceeded_cb() callback so that we don't need to access vy_env::status from the scheduler code. Note, after this change we have to set vy_env::status to VINYL_ONLINE before calling vy_quota_set_limit(), because the latter might schedule a dump. - Check if we have anything to dump from vy_begin_checkpoint() instead of vy_scheduler_begin_checkpoint(). This will allow us to isolate the scheduler code in a separate file.
Loading
Please register or sign in to comment