stackabletech / stackabletech/hdfs-operator
Topology Provider permissions briefly dropped during reconciliation when the reflector watch resets
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 53
- Forks
- 9
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 10
Description
Affected Stackable version
Any up to and including SDP 26.3.0
Affected Apache HDFS version
N/A
Current and expected behavior
In the HDFS operator (and perhaps any operator based on kube-rs), when the Reflector watch resets, the Store has to be rebuilt.
Reconciliations before the Store is fully consistent can lead to service accounts being dropped from (Cluster)RoleBindings. The leads to the Topoology Provider not being able to determine the topology (or possibly builds an incorrect topology?)
The expected behaviour is that the above doesn't happen 😅.
Possible solution
We can requeue reconciliations (at least for some operations) until the store is fully consistent.
Eg:
- On error: log error and return early
watcher::Event::Init-> the store is empty, waiting for InitApply events, requeue/return early.watcher::Event::InitApply-> store is partially populated, requeue/return early until InitDone.watcher::Event::InitDone-> store is populated, continue with reconcilewatcher::Event::Apply-> store is populated, continue with reconcilewatcher::Event::Delete-> store is populated, continue with reconcile
[!CAUTION]
I haven't checked to see whether we can and should requeue, or just return an error which bubbles up as a Result for the error_policy handler which logs and does requeues.
Regardless, we need to make sure it eventually is reconciled and not just ignored.
Additional context
My understanding of the problem/solution should be double checked with someone else.
[!TIP]
This might only be when the topology provider is used... but also seems like something that might affect other products that have components that interact with Kubernetes API in SDP generally
Environment
No response
Would you like to work on fixing this bug?
yes
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the HDFS operator's reconciliation path and the kube-rs Reflector watcher event handling, especially Store rebuilds and RoleBinding updates. Check how Init, InitApply, InitDone, Apply, Delete, and error events currently affect reconciliation. Done means reconciliations cannot act on an empty or partially populated Store, service-account permissions are preserved, and the work is eventually requeued.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kubernetes, rust
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 42/100