Split off batched reconciler into its own constructor

Open
#161 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
go
Domain
databases

Research direction

Start by locating reconciler.New, BatchOperations, and the retry handling in the reconciler package. Trace how single-object and batched reconciliation currently interact, then verify that separate constructors, BatchOperations.Prune, and batch retry behavior cover both supported modes without requiring unused operations.

Written by the indexing model from the issue text.

Description

The current reconciler.New takes both reconciler.Operations and reconciler.BatchOperations. The BatchOperations can be nil in which cases objects are reconciled one at a time.

This API seems to lead to many users assuming that both Operations and BatchOperations need to be implemented. Make the API easier to use correctly by removing the BatchOperations parameter from reconciler.New and introducing a reconciler.NewBatchReconciler constructor. Extend BatchOperations with Prune method and refactor the reconciler to work without single object reconciliation (e.g. the retry handling which should be able to retry a batch).

Dominant language
Go
Stars
103
Forks
5
PR merge metrics
No merged PRs in 30d

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cilium/statedb

All issues in cilium/statedb

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.