fix: nodemetric version comparison#969
Conversation
|
Hi @yulken thanks for looking into that. There should be a "synthetic watcher" somewhere in steve that essentially polls the data for non-watchable APIs. I vaguely remember it not working correctly but have forgotten about it. That would fix the NodeMetrics issue. As for Pod restart column, I remember it being mentioned somewhere, not sure if it's your issue or some other issue 🤔, I'll have to check. To fix this, we're likely going to want to extract column data that we receive from the api server and store it differently. Basically, same thing as we do with the other duration columns. We shouldn't bypass the cache since the new filters / sorting functionality depends on it. |
|
There we go, found it: rancher/rancher#52217 |
|
Thank you @tomleb. I'll investigate this synthetic watcher. |
db5b321 to
1a82b5a
Compare
|
@tomleb I found the root cause for this issue: The thing is that I tried comparing timestamps specifically for Ps.: I also added .vscode to |
tomleb
left a comment
There was a problem hiding this comment.
The solution to fix it for NodeMetrics makes sense.
Can you add at least a test?
I'd like to check with UI (@richard-cox) on how we should tackle this to support HA (aka when Rancher has multiple replicas). Without a resourceVersion, the logic where we avoid "stale" data via revision=X doesn't really work.
Are we using mode=resources.changes with NodeMetrics?
|
@tomleb which specific resource are we talking about?
|
TIL, didn't know this was a thing. Why do we do that? I see the schema also reports You're right that in theory the data wouldn't be stale for too long, might always be 1 "state" behind. Are we okay with this? What about the general case? |
Not quite sure. the resources themselves look exactly the same as well
Until it becomes an issue i say we stick with what we have. In terms of the general case how do you mean? |
There might be other resources coming from Extensions API server that will also be list-able but not watch-able. Maybe we'd want to handle the general case now. Though I'm tempted to go with "Until it becomes an issue i say we stick with what we have." for that as well. So maybe let's just "wait-and-see" in that case. |
1a82b5a to
1ebfeaf
Compare
This PR addresses the following issues:
Analyzing the case, I noticed that setting the flag features=ui-sql-cache=false made the metrics collection work as expected.
In summary, the thing is that
NodeMetricsis not natively compatible with thewatchverb, meaning its cache will never be updated after Steve starts.Similarly, the "Restarts" data for the pod will also not be updated once it is cached, unless there is a modification to the pod itself.