Skip to content

SOLR-16398: Add V2 JAX-RS APIs for GET replication restore status and commits. - #5217

Merged
epugh merged 14 commits into
apache:mainfrom
jaykay12:SOLR-16398-replication-phase2
Oct 26, 2026
Merged

epugh merged 14 commits into
apache:mainfrom
jaykay12:SOLR-16398-replication-phase2

Conversation

@jaykay12

@jaykay12 jaykay12 commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

https://issues.apache.org/jira/browse/SOLR-16398

Description

Add V2 JAX-RS APIs for GET replication restore status and commits.

Solution

Used Cursor for approach & self-code reviews. Code is fully vetted by Jalaz Kumar.

Tests

  • CoreReplicationAPITest
  • FetchCommitsAPITest
  • FetchRestoreStatusAPITest

Checklist

Please review the following and check all that apply:

  • I have reviewed the guidelines for How to Contribute and my code conforms to the standards described there to the best of my ability.
  • I have created a Jira issue and added the issue ID to my pull request title.
  • I have given Solr maintainers access to contribute to my PR branch. (optional but recommended, not available for branches on forks living under an organisation)
  • I have developed this patch against the main branch.
  • I have run ./gradlew check.
  • I have added tests for my changes.
  • I have added documentation for the Reference Guide
  • I have added a changelog entry for my change

@github-actions github-actions Bot added documentation Improvements or additions to documentation tests cat:api labels Oct 24, 2026

@jaykay12 jaykay12 left a comment •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self-review ✅
precommit ✅

local testing [pending][will do after first round of review]

@epugh @gerlowskija Can you trigger github copilot review to start with?


@GET
@CoreApiParameters
@Path("/restore/status")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

although V2 api sheet suggests GET /restore for this, but imo, GET /restore/status is more comprehensive.

@nick-boss-tech

Copy link
Copy Markdown
Contributor

Quick Review:
The v1 commits handler now converts commit entries into objects, changing the existing JSON response for callers requesting json.nl=flat or other array styles.
Preserve plain NamedList entries in the v1 adapter and add a serialization regression test. The ordinary v2 paths otherwise look coherent.

AI-generated. Static review.

@epugh epugh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@epugh epugh added this to the 10.x milestone Oct 26, 2026
@epugh

epugh commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Quick Review: The v1 commits handler now converts commit entries into objects, changing the existing JSON response for callers requesting json.nl=flat or other array styles. Preserve plain NamedList entries in the v1 adapter and add a serialization regression test. The ordinary v2 paths otherwise look coherent.

AI-generated. Static review.

Is this something we can solve in a seperate PR @jaykay12 ? @nick-boss-tech do you by chance have a unit test demonstrating the issue?

@nick-boss-tech

nick-boss-tech commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

a unit test demonstrating the issue?

@epugh Yes. The test is on a fork branch rather than this PR: diff against this branch. It adds ReplicationCommitsV1ResponseTest with two cases for command=commits, one with json.nl=flat and one with the default JSON style.

Result on each side. Both cases pass on base 07fdebd and fail on this head 9599df2. On this head, each commit entry comes back as a map ({indexVersion=..., generation=..., filelist=[...]}) instead of the flat name/value array. The default json.nl is flat, so callers who don't set a style are affected too, not only the non-default ones.

Cherry-pick onto this branch. Validated from a fresh clone of jaykay12/solr:


git clone https://github.com/jaykay12/solr.git
cd solr
git switch SOLR-16398-replication-phase2
git remote add nick https://github.com/nick-boss-tech/solr.git
git fetch nick solr-16398-v1-commits-shape-test
git cherry-pick d7a6368702f8785fc6cd097641ad1ecd0fe2552e

AI-generated.

Adjacent ticket that I worked on. arrntv keeps NamedList entries in a fixed array shape, so its tests are a useful reference for the 5217 fix.
https://issues.apache.org/jira/browse/SOLR-17268

@jaykay12

jaykay12 commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor Author

all 6 CI checks are ✅
Latest master merged.

Local testing ✅

Scenario main feature
V1 /commits Screenshot 2026-10-26 at 10 57 58 PM Screenshot 2026-10-26 at 11 07 59 PM
- - -
V2 /commits Does not exist ❌ Screenshot 2026-10-26 at 11 08 56 PM
- - -
V1 restore status Screenshot 2026-10-26 at 11 03 35 PM Screenshot 2026-10-26 at 11 09 32 PM
- - -
v2 restore status Does not exist ❌ Screenshot 2026-10-26 at 11 10 04 PM

@jaykay12

jaykay12 commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor Author

Is this something we can solve in a seperate PR @jaykay12 ?

yes, sure @epugh this will be a quick fix in a follow-up PR.

I also checked it via local testing, what nick pointed out is this change in the v1 response. I will also see if any past api also got any such regression or not as well, that will also be part of this fix PR.

Screenshot 2026-10-26 at 11 16 03 PM

@epugh

epugh commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

humm, I wonder if we should just pull in the test that @nick-boss-tech mentioned, and fix here? Otherwise, I sort of feel like I should create a JIRA to track this so we don't forget?

@jaykay12

jaykay12 commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor Author

This PR is almost ready, I won't forget for sure, have added it in my task list.

I can initialise a draft PR for now, if that eases you 😁

But if tracking via Jira is something you recommend, that works as well.

@epugh

epugh commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

This PR is almost ready, I won't forget for sure, have added it in my task list.

I can initialise a draft PR for now, if that eases you 😁

But if tracking via Jira is something you recommend, that works as well.

you have eased my mind! It's one of htose things, if we forget it bites us down the road ;-)

@epugh
epugh merged commit e59ce3c into apache:main Oct 26, 2026
6 checks passed
@jaykay12
jaykay12 deleted the SOLR-16398-replication-phase2 branch October 27, 2026 17:38
dsmiley pushed a commit that referenced this pull request Oct 28, 2026
… commits. (#5217)

Co-authored-by: Eric Pugh <epugh@opensourceconnections.com>
(cherry picked from commit e59ce3c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cat:api documentation Improvements or additions to documentation tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants