-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[HTTP] How will Kibana server detect a different version UI on serverless? #159127
Comments
Pinging @elastic/kibana-core (Team:Core) |
Pinging @elastic/appex-sharedux (Team:SharedUX) |
I think the first step would be to actually define what Is that deployment-based:
Or just something at the application level:
Where I want to go is: do we need our system to communicate with some higher-level service (e.g the Kibana controller or something) to know about this "is an update available" information, or is this something we assume we will be able to detect in isolation, just between our UI and server? Now my 2 cps regarding how we can communicate that info between client and server:
|
++ Just wanted to leave a flyby comment to give a 👎 vote to service workers. Feels like overkill, and like they could add more risk than they help mitigate. |
Thanks both @lukeelmers @pgayvallet for the clarifying comments/questions.
I was thinking about it as: the Kibana UI would simply detect that it is talking to a newer server version and that would be the prompt to consider updating. It could be that assumption is wrong and that is not how we want the "update available" prompt to be triggered. Maybe we want a more definitive "push" to clients that a new version is available not just that you are talking to a new server, but as you point out this requires systems outside just Kibana client/server.
++ service workers would be the most work but do afford leveraging browser capabilities like managing state across multiple open pages (if we wanted that). but I can see the case for not wanting to use this as the time to explore service workers.
++ also primarily leaning in this direction as it seemed simplest to get working.
Just curious, is there a security risk you are thinking of? |
Nope, the only risk I'm referring to here is risk to the project, i.e. risk of delays or unforeseen bugs due to starting with a more complex approach than is necessary for the MVP. That doesn't mean we can't go back later and change the implementation if we determine service workers are the only way to achieve the UX we want, I'd just caution against taking the more complex route up front. |
Just dropping my 2-cents: I think a header returning the buildNumber could be enough for the browser to notice that it's running on a different version (mind that I'm not using newer because rollbacks might be an use case to keep in mind). I think that the At the moment, if not refreshed, I would expect the UX to break as soon as the user requires a new chunk to be downloaded. This may be minimized if, in the future, we decide to use CDN for bundles and assets, but for the MVP, I think this could be good enough for now. Finally, I'd like to raise some awareness of the main edge case: the moment we are upgrading the nodes, some requests may be served from the new nodes, and some from the old ones. Typically, the proxy is round-robin, so the chances of a single user hitting both nodes are really high (receiving a Please refresh message, no matter which buildNumber they loaded). I recall someone said that a typical use case is to have one Kibana UI node, so we may want to look at this issue post-MVP. Happy to discuss it now, if you think we should handle that situation right now. |
Yes, I tested this locally and you get "stuck" as the bundle download returns 404 however the UI did not hard crash in my test case. Still not good.
Yeah, this is a good point. I called this the "flip-flop" issue 😄 . Another, related issue is lack of forward compatibility (FC) between UI and server (maybe the new UI expects new versions of endpoints to be available but then gets routed to N-1 server which gives I was hoping we could mitigate this at the orchestration layer OR we could make detection a little more sophisticated. For example:
It might be worth waiting for our first set of Kibana releases (not in production) so that we can verify where the biggest issues during the rolling upgrade window are and then consider best ways to mitigate or address. Depending on how we address that, the mechanism for detecting updates (headers) could be orthogonal or do you think of them as fundamentally related @afharo ? |
++ I think we can address the edge case once we know better its actual impact. I'd apply the 80/20 rule here and move on without thinking about the "flip-flop" edge case. We can address it later :) |
++ Our assumption here are
I would say the order of priorities are:
|
Had a chance to re-read the design doc on this, and wanted to add a few questions/thoughts as I'm not sure if there is an agreed-upon approach yet.
|
I agree with Luke: I'm not convinced we need to do this, yet. We don't know if this is (going to be) a problem yet, and it has a dead simple solution. On the other hand, I'm in favor of some kind of release note dialog when the system is upgraded for the user experience. They're running this project to be fully managed, let's show them we're managing it with updates. That's a step short of "refresh your browser", though. The most important thing, in my mind, adding metadata to our logging with UI + Server build information. We could see, when an upgrade is done, how many projects lag. It may turn out that, after an upgrade, 30% of projects are mismatched and we see that drop to 2% in 24 hours. Or we could see a 50% mismatch and a drop to 15% over two weeks. Either way, we'll have data and curves to be able to understand the landscape and if any UX solution is needed. |
Related #161594 |
With the help of product, we decided the answer is "no", at least for now. But I like Clint's idea of having some indication that a new release is ready, but we can defer this to future iterations. Since our thinking has evolved on the original issue here are my thoughts on technical details of an approach to just detecting old browsers/UIs on Kibana server. Proposal for detecting old UIsOn serverless we will be deploying versions "between" stack versions but we only communicate the stack version today (i.e. 8.9.0) via the We modify the version being sent via
I prefer (1), I also think it will be easier to implement as it remains largely compatible with how this value is used today, but I can also see a case for (2) in that "stack version" is not really a thing on serverless anymore. Note: we have a way to get a unique build number for Kibana, this will be a number like 64910 not an actual commit SHA. In development we just set this to Node.js' max int. See: One other point, asked by @jbudz is that using the build number we generate today also communicates a sequence: higher numbers mean newer builds, relevant if we are considering adding a SHA-like value. Let's discuss some other ideas too! Detecting a mismatch is step 1, but we'd like to capture/trace this metadata to any errors that result from the request too. Errors in Kibana can happen for any number of reasons and so we'd need to narrow down what information is readily available at the time of error. One idea to narrow this down is to say that we want to detect any |
Closing this issue in favor of #162332 |
Original issue
Initial ideas about "detecting" a new version from the UI and notifying the user in some way. We might return to this in the future
(1) Adding custom response headers when an old UI build is detected
(2) A dedicated endpoint that gets checked by UIs (not the greatest...)
(3) Using service worker lifecycle events, although this might not result in detecting immediate updates if we rely on the bit-wise detection of an update
(4) ...what else?
The text was updated successfully, but these errors were encountered: