Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
loader: create S3 bucket objects (which need credentials) on demand
The write VFS (that produces replication data) sometimes needs a loader, but usually doesn't. Before this commit, creating a loader could perform (local) network I/O to get credentials. We now wait until we actually have to make an S3 API call (to fetch a chunk) before getting the credentials. Sample debug printer output: ``` $ cargo test loader -- --nocapture Compiling verneuil v0.6.4 (/home/pkhuong/open-sauce/verneuil) Finished `test` profile [unoptimized + debuginfo] target(s) in 3.28s Running unittests src/lib.rs (target/debug/deps/verneuil-106bf643236b6261) running 1 test Delayed Loader: Loader { cache: Cache { write_side: None, auto_sync: true, read_side: ReadOnlyCache { stack: [] } }, remote_sources: None, known_chunks: {} } Resolved Loader: Loader { cache: Cache { write_side: None, auto_sync: true, read_side: ReadOnlyCache { stack: [] } }, remote_sources: [RedactedBucket { name: "test-bucket", region: UsEast1 }], known_chunks: {} } test loader::tests::test_loader_no_credential ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 44 filtered out; finished in 0.00s ```
- Loading branch information