oxidecomputer / crucible

A storage service.
Mozilla Public License 2.0
166 stars 17 forks source link

Increment write backpressure before deferred encryption #1444

Closed mkeeter closed 3 weeks ago

mkeeter commented 3 weeks ago

(Staged on top of #1443 )

This PR tightens the feedback loop for backpressure, by incrementing our counters before encryption is complete. It uses the new RAII BackpressureGuard type, so we don't need to worry about weird accounting failures.

Before:

                ┌────────────┐ incr             
             ┌──┤backpressure│◄───┐             
             │  └────────────┘    │             
┌─────┐  ┌───▼──┐    ┌──────────┐ │    ┌───────┐
│Guest├─►│submit├───►│encryption├─┼───►│clients│
└───▲─┘  └──────┘    └──────────┘ │    └───────┘
    │                             │             
    └─────────────────────────────┘             
              ack                               

After:

                ┌────────────┐                  
             ┌──┤backpressure│                  
             │  └─▲──────────┘                  
             │    │incr                         
┌─────┐  ┌───▼──┐ │  ┌──────────┐      ┌───────┐
│Guest├─►│submit├─┴─►│encryption├─┬───►│clients│
└───▲─┘  └──────┘    └──────────┘ │    └───────┘
    │                             │             
    └─────────────────────────────┘             
              ack                               
mkeeter commented 3 weeks ago

This failed CI in test-up-encrypted: https://github.com/oxidecomputer/crucible/runs/29621235532

I'm rerunning now to see if it was a flake or reproducible