isaric opened a new pull request, #5407:
URL: https://github.com/apache/solr/pull/5407

   https://issues.apache.org/jira/browse/SOLR-18612
   
   # Description
   
   SIP-22 step 5, the Overseer slice (after #5311, #5326, #5336 and #5365). It 
covers the `results` list that `OverseerCollectionMessageHandler` and the 
distributed command runner hand to every Collections API command, the wrappers 
around it (`OverseerTaskProcessor` lock-failure response, 
`DistributedApiAsyncTracker` crash response, `OverseerConfigSetMessageHandler`, 
the async-submit echo in `CollectionsHandler`, the snapshot commands' per-shard 
results) and the result lists the commands pass to each other (`addResult`, 
`deleteResult`, `rollback`, `cmdResults`, throwaways).
   
   These were left out of the earlier slices because `results` could 
legitimately repeat keys. David agreed on the JIRA to fix the producers first, 
even though it changes the response structure.
   
   # Solution
   
   **Producers that repeated keys** (first commit worth reading, 
`CollectionHandlingUtils` and the five commands):
   
   - `DeleteShardCmd` added a `failure` string and a `success` map once per 
replica.
   - `DeleteReplicaCmd` added a `failure` string per failed core, next to the 
`failure` map that `processResponses` builds.
   - `ReplicaMigrationUtils` (REPLACENODE, DELETENODE, MIGRATE_REPLICAS, 
BALANCE_REPLICAS) added a `failure` string per failed add, cleanup or delete.
   - `MaintainRoutedAliasCmd` added one `create` per collection it created.
   
   They now merge into the single `success` / `failure` map keyed by 
`node/core` that `CREATE`, `ADDREPLICA` and `CREATESHARD` always produced, 
through two small helpers in `CollectionHandlingUtils` (`successMap`, 
`failureMap`) that `addSuccess` / `addFailure`, `CreateShardCmd` and 
`RestoreCmd` also use now. `MAINTAINROUTEDALIAS` reports one `create` object 
keyed by collection. Where a response used to carry a formatted message, the 
underlying per-core failure is reported instead and the message goes to the log.
   
   **Type change**: 38 `new NamedList<>()` become `new SimpleOrderedMap<>()` 
across the Overseer and command code. Variable types stay `NamedList<Object>`, 
as in the earlier slices.
   
   **User-visible**: only the merge. The container type is not visible: 
`CollectionsHandler` copies the Overseer response into the request's values 
(`rsp.getValues().addAll(...)`), and `REQUESTSTATUS` copies it into a map. That 
map is also why repeated keys were already lossy there, and 
`CollectionAdminResponse.getErrorMessages()` returned only the first `failure`. 
Documented in the Solr 11 upgrade notes and the changelog.
   
   AI disclosure: the site classification, the edits, the notes and this 
description were drafted with Claude Code and reviewed by me.
   
   # Tests
   
   - New `DeleteShardTest.deleteShardReportsEachReplicaOnce`: DELETESHARD of a 
shard with two replicas returns one `success` entry with two replicas.
   - `DeleteReplicaTest.deleteReplicaByCount` now asserts the response shape 
too.
   - Ran the suites that exercise the touched commands: `DeleteShardTest`, 
`DeleteReplicaTest`, `ReplaceNodeTest`, `DeleteNodeTest`, `MoveReplicaTest`, 
`MigrateReplicasTest`, `BalanceReplicasTest`, `CollectionsAPISolrJTest`, 
`CollectionsAPIDistributedZkTest`, `CollectionsAPIAsyncDistributedZkTest`, 
`TestCollectionAPI`, `TestRequestStatusCollectionAPI`, 
`AsyncCallRequestStatusResponseTest`, `DistributedApiAsyncTrackerTest`, 
`OverseerTest`, `TestConfigSetsAPI`, `ReindexCollectionTest`, 
`SplitByPrefixTest`, `TestLocalFSCloudBackupRestore`, 
`CreateCollectionCleanupTest`, `CreateRoutedAliasTest`, 
`TimeRoutedAliasFixStartTest`: 178 tests, all pass. The routed-alias update 
processor tests are `@AwaitsFix` upstream and did not run. Plus `./gradlew 
check -x test`.
   
   # Checklist
   
   Please review the following and check all that apply:
   
   - [x] I have reviewed the guidelines for [How to 
Contribute](https://github.com/apache/solr/blob/main/CONTRIBUTING.md) and my 
code conforms to the standards described there to the best of my ability.
   - [x] I have created a Jira issue and added the issue ID to my pull request 
title.
   - [x] I have given Solr maintainers 
[access](https://help.github.com/en/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork)
 to contribute to my PR branch. (optional but recommended, not available for 
branches on forks living under an organisation)
   - [x] I have developed this patch against the `main` branch.
   - [x] I have run `./gradlew check`.
   - [x] I have added tests for my changes.
   - [x] I have added documentation for the [Reference 
Guide](https://github.com/apache/solr/tree/main/solr/solr-ref-guide)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to