Open gandro opened 2 months ago
Agree with Operations
also getting the revision. Let's accumulate some more API changes and release this as part of v0.4.
The BatchOperations
interface I'm not too happy about as there's fair bit of allocations going on. This is why I also didn't do batch ops in pkg/bpf/ops_linux.go
as there wasn't too much benefit to using a BPF batch op due to the inefficiency of the interface (less sys CPU time spent though...). I think I would like to revisit its design and see if we can make it work nicely with BPF map batch updates with minimal copying and allocations. Perhaps using iter.Seq2[Obj, *Result]
to avoid the []BatchEntry
slice allocation and on the BPF ops side having largeish buffers in sync.Pool that we reuse.
Consider the reconciler operations interfaces (as of v0.2.x):
Implementors of the batch are able to obtain the object revision, where as implementers of the single operations interface are not. Since the
Operations
interface is mandatory, clients might want to implement part of theOperations
interface on top of theBatchOperations
interface (basically issuing batches containing a single element). But this is currently not possible, because invokingBatchOperations
requires a revision not given to theOperations
implementation.Thus, this issue suggests that the
Operations
methods also get a StateDB revision for each passed object.