Repository navigation
SOLR-16396 | Migrate GET /config/overlay and GET /config/znodeVersion to JAX-RS. - #5022
Conversation
|
Okay, I did some testing, and with some ai help apparently event hoguh we have v2 apis, the code path is going via the v1 path! See this curl where we ask for xml but get back json? and we expect a 406 not a 200: |
|
The new JAX-RS registrations for Functionally this is fine today since Given the PR description already lists the remaining |
|
I think we need to make |
|
Thanks for tracing this, Eric, and for the Accept: application/xml curl. You are right that That is intentional for this PR. The remaining On your third comment. I would rather leave the single wildcard in place and do that cutover once, in the last follow-up, when nothing is left on {component}. |
Test Evidences GET znodeVersionhttp://localhost:8983/solr/techproducts/config/znodeVersion
http://localhost:8983/api/collections/techproducts/config/znodeVersion
http://localhost:8983/solr/techproducts/config/znodeVersion?params=0&overlay=2
http://localhost:8983/api/collections/techproducts/config/znodeVersion?params=0&overlay=2
|
| @Override | ||
| public SolrParams getParams() { | ||
| final ModifiableSolrParams params = new ModifiableSolrParams(); | ||
| final ModifiableSolrParams solrParams = new ModifiableSolrParams(); |
There was a problem hiding this comment.
can you give some context on why this rename is needed? Is this a tidy, or was the name clashing? for soem reason i get nervoius every time we touch the mustache templating, maybe cause it seems like magic!
There was a problem hiding this comment.
Not a tidy - it was a name clash.
I hit it via a failing test -
https://github.com/jaykay12/solr/blob/cf8b0220fd4c94759e20a857a2b6ba29d64206e2/solr/core/src/test/org/apache/solr/handler/admin/api/GetConfigTest.java#L72
Actually getZnodeVersion has @QueryParam("params"), so codegen produces a field/local named params. The template then emitted params.add(...) on a local also called params, which failed to compile. Renaming the local to solrParams avoids colliding with any query param named params. Behavior of the generated clients is unchanged.
this change in mustache templating was suggested to me by Cursor, when debugging the failed test, since it was local variable renaming, & test passed post this renaming so felt safe to me!
There was a problem hiding this comment.
Thanks! thats interesting that we have to think about this...
There was a problem hiding this comment.
i wonder if there are otehr non migrated V2 apis that are going to trigger this type of thing?
Thanks for explaining this to me.... With the final cutover being at the end, it does mean that each of these PR's isn't a complete feature, in that from an external perspective, we never actually exercise these new apis... Which I suppose is fine as long as we make it to that final cut over!!! Does teh fact that we never exercise the new apis mean the screen shots aren't actually meaningful? Because the v2 calls are just routed to the old v1 endpoint and returned right? Whcih is fine if our goal is to have java code validation, and then do a cut over at the end??? Just want to make sure I am underrstanding things.... |
A quck thoguh, what if instead of a wildcard, we just had explicit /config/componentA, /config/componentB, /componentC that explicitly listed out each of the end points, then we could migrate completely and just delete them one by one? |
Yeah, you’ve got the picture right. One small nuance on “routed to the old v1 endpoint”: the /api/.../config/overlay and /znodeVersion calls still come in on the V2 path (V2HttpCall). What happens is ApiBag matches the existing AnnotatedApi wildcard /config/{component} in GetConfigAPI before Jersey ever gets a look, so they go AnnotatedApi → SolrConfigHandler.handleGET → GetConfig (via squash). They never hit the Jersey-registered getOverlay() / getZnodeVersion() methods - which is why your Accept: application/xml curl still comes back as JSON/200 instead of a 406. So the screenshots are meaningful as a regression check that response bodies stay equivalent after moving the logic into GetConfig, not as proof that Jersey owns the route. also, screenshots are my own personal ways of actually understanding what actually changes to the end user with my each ongoing change, & those testing also aids as an actual testing evidence for me. I will do similar ones, once we do final cutover. |
That’s a fair idea - if we listed each My preference would be to skip that detour if we can. Expanding the wildcard into temporary endpoints just so we can delete them again feels like throwaway work, and V2 is still experimental. The plan is to land the remaining /config/{component} pieces and then cut over once at the end (same as #4951), so I was hoping to keep the single wildcard until then. That said, I’m not stuck on it - if you've strong inclination on us doing that, I’m happy to do that. |
|
If you don't mind, lets do it, because then I can feel like we ahve a "complete feature" in each PR. Especially if we get stuck, and maybe some lands on 10.2 and some on 10.3.. Though I do suspect it will all be on 10.2!!!! Also, then I get the visual satisfaction of seeing us eliminate each one of htose lines from this PR forward ;-) Also, this lets us update Google spreadsheet after each merge to flip JAX RS to "true" ;-) |
Ha, fair enough - the “flip it to true in the spreadsheet” argument is pretty convincing 😄 Quick process question before I dig in: for the explicit AnnotatedApi registrations (replacing /config/{component} with a concrete path list so we can peel them off one by one), would you rather I:
I’m fine either way, I just don’t want to bake the wrong sequencing in. For now, i am working via route 2, if you suggest otherwise i will move those changes in this PR. |
|
i think this PR is fine.. We;ll merge this one very very soon! |
|
just did the curl test, yay! |























https://issues.apache.org/jira/browse/SOLR-16396
Description
Migrate GET /config/overlay and GET /config/znodeVersion to JAX-RS.
Solution
Yes, Used Cursor for approach formulation.
Future Plan
Later follow-ups (not next PR)
Tests
(overlay map has znodeVersion; versions >= -1).
Checklist
Please review the following and check all that apply:
mainbranch../gradlew check.