mirror of
https://github.com/neondatabase/neon.git
synced 2026-07-04 04:30:38 +00:00
THE PLAN
- Timeline::get calls reconstruct data ⇒ turn that into a Pin<Box<dyn Future…>> .
- Problem there: we call layer.get_reconstruct_data while holding layer map lock ⇒ it’s a std rwlock ⇒ need to turn it into tokio mutex
- Problem there: we sometimes hold the Tenant::timelines std mutex while holding layer map lock (branching?) ⇒ need to turn it into tokio mutex
- Prolem there: tenant.rs `self.state.send_modify(|| { ... timelines.lock().await })`;
Can't await inside the closure, and we don't have async closures.
And we don't control the tokio::sync::watch API.
So, tackle things in reverse here.
This commit is contained in: