[native] Notify backup uploader after compaction creation
Summary: After JS schedules new backup compaction creation we want to keep track of the promise_id so we can resolve/reject it after the operation. But the logic is split Rust -> C++ (compaction creation) -> Rust (upload to backup service) so we need to keep a map from backupID to the promise id.
Test Plan:
Tested with the later diff but things that touch this code in particular:
- tested that the promise resolved after successful upload
- tested that the promise rejected with a correct message after an error on the Rust side
- tested that the promise rejected with a correct message after an error on the C++ side
The testing code looks roughly like this:
if let Err(err) = rust_op_that_can_fail().await { compaction_upload_promises::resolve(&backup_id, Err(err)); return; } let (future_id, future) = future_manager::new_future::<()>().await; cpp_that_can_fail(future_id); if let Err(err) = future.await { compaction_upload_promises::resolve(&backup_id, Err(err)); return; } compaction_upload_promises::resolve(&backup_id, Ok(()));
Reviewers: marcin, bartek, kamil
Reviewed By: marcin, bartek, kamil
Subscribers: ashoat, tomek
Differential Revision: https://phab.comm.dev/D10858