Skip to content

Commit ea7bead

Browse files
committed
SOLR-18219: Rename the CoreAdmin UPGRADECOREINDEX action to UPGRADEINDEX for a cleaner API with reduced verbosity (#4387)
1 parent 4f74422 commit ea7bead

7 files changed

Lines changed: 24 additions & 24 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ This file lists Solr's raw release notes with details of every change to Solr. M
2424
- Added new ConcurrentUpdateJdkSolrClient that works with HttpJdkSolrClient [SOLR-18065](https://issues.apache.org/jira/browse/SOLR-18065) (James Dyer)
2525
- Support including stored fields in Export Writer output. [SOLR-18071](https://issues.apache.org/jira/browse/SOLR-18071) (Luke Kot-Zaniewski)
2626
- Introducing support for multi valued dense vector representation in documents through nested vectors [SOLR-18074](https://issues.apache.org/jira/browse/SOLR-18074) (Alessandro Benedetti)
27-
- CoreAdmin API (/admin/cores?action=UPGRADECOREINDEX) to upgrade an index in-place [SOLR-18096](https://issues.apache.org/jira/browse/SOLR-18096) (Rahul Goswami)
27+
- CoreAdmin API (/admin/cores?action=UPGRADEINDEX) to upgrade an index in-place [SOLR-18096](https://issues.apache.org/jira/browse/SOLR-18096) (Rahul Goswami)
2828
- CrossDC Consumer - add Prometheus metrics [SOLR-18060](https://issues.apache.org/jira/browse/SOLR-18060) (Andrzej Bialecki @ab)
2929
- CrossDC - support arbitrary Kafka properties [SOLR-18062](https://issues.apache.org/jira/browse/SOLR-18062) (Andrzej Bialecki @ab)
3030

solr/core/src/java/org/apache/solr/handler/admin/CoreAdminOperation.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
import static org.apache.solr.common.params.CoreAdminParams.CoreAdminAction.STATUS;
3939
import static org.apache.solr.common.params.CoreAdminParams.CoreAdminAction.SWAP;
4040
import static org.apache.solr.common.params.CoreAdminParams.CoreAdminAction.UNLOAD;
41-
import static org.apache.solr.common.params.CoreAdminParams.CoreAdminAction.UPGRADECOREINDEX;
41+
import static org.apache.solr.common.params.CoreAdminParams.CoreAdminAction.UPGRADEINDEX;
4242
import static org.apache.solr.handler.admin.CoreAdminHandler.CallInfo;
4343

4444
import java.lang.invoke.MethodHandles;
@@ -258,7 +258,7 @@ public enum CoreAdminOperation implements CoreAdminOp {
258258

259259
V2ApiUtils.squashIntoSolrResponseWithoutHeader(it.rsp, response);
260260
}),
261-
UPGRADECOREINDEX_OP(UPGRADECOREINDEX, new UpgradeCoreIndexOp());
261+
UPGRADEINDEX_OP(UPGRADEINDEX, new UpgradeCoreIndexOp());
262262

263263
final CoreAdminParams.CoreAdminAction action;
264264
final CoreAdminOp fun;

solr/core/src/java/org/apache/solr/handler/admin/UpgradeCoreIndexOp.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public void execute(CoreAdminHandler.CallInfo it) throws Exception {
5454
if (it.handler.coreContainer.isZooKeeperAware()) {
5555
throw new SolrException(
5656
SolrException.ErrorCode.BAD_REQUEST,
57-
"action=UPGRADECOREINDEX is not supported in SolrCloud mode. As an alternative, in order to upgrade index, configure LatestVersionMergePolicyFactory in solrconfig.xml and reindex the data in your collection.");
57+
"action=UPGRADEINDEX is not supported in SolrCloud mode. As an alternative, in order to upgrade index, configure LatestVersionMergePolicyFactory in solrconfig.xml and reindex the data in your collection.");
5858
}
5959

6060
SolrParams params = it.req.getParams();

solr/core/src/java/org/apache/solr/handler/admin/api/UpgradeCoreIndex.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@
6868
import org.slf4j.LoggerFactory;
6969

7070
/**
71-
* Implements the UPGRADECOREINDEX CoreAdmin action, which upgrades an existing core's index
72-
* in-place by reindexing documents from segments belonging to older Lucene versions, so that they
73-
* get written into latest version segments.
71+
* Implements the UPGRADEINDEX CoreAdmin action, which upgrades an existing core's index in-place by
72+
* reindexing documents from segments belonging to older Lucene versions, so that they get written
73+
* into latest version segments.
7474
*
7575
* <p>The upgrade process:
7676
*
@@ -153,7 +153,7 @@ private UpgradeCoreIndexResponse performUpgradeImpl(
153153
if (indexContainsChildDocs(searcherRef.get())) {
154154
throw new SolrException(
155155
BAD_REQUEST,
156-
"UPGRADECOREINDEX does not support indexes containing child/nested documents. "
156+
"UPGRADEINDEX does not support indexes containing child/nested documents. "
157157
+ " Consider reindexing your data "
158158
+ "from the original source.");
159159
}

solr/core/src/test/org/apache/solr/handler/admin/UpgradeCoreIndexActionTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public void testUpgradeCoreIndexSelectiveReindexDeletesOldSegments() throws Exce
8787
admin.handleRequestBody(
8888
req(
8989
CoreAdminParams.ACTION,
90-
CoreAdminParams.CoreAdminAction.UPGRADECOREINDEX.toString(),
90+
CoreAdminParams.CoreAdminAction.UPGRADEINDEX.toString(),
9191
CoreAdminParams.CORE,
9292
coreName),
9393
resp);
@@ -132,14 +132,14 @@ public void testUpgradeCoreIndexAsyncRequestStatusContainsOperationResponse() th
132132

133133
final Set<String> segmentsBeforeUpgrade = listSegmentNames(core);
134134

135-
final String requestId = "upgradecoreindex_async_1";
135+
final String requestId = "upgradeindex_async_1";
136136
CoreAdminHandler admin = new CoreAdminHandler(h.getCoreContainer());
137137
try {
138138
SolrQueryResponse submitResp = new SolrQueryResponse();
139139
admin.handleRequestBody(
140140
req(
141141
CoreAdminParams.ACTION,
142-
CoreAdminParams.CoreAdminAction.UPGRADECOREINDEX.toString(),
142+
CoreAdminParams.CoreAdminAction.UPGRADEINDEX.toString(),
143143
CoreAdminParams.CORE,
144144
coreName,
145145
CommonAdminParams.ASYNC,
@@ -213,7 +213,7 @@ public void testNoUpgradeNeededWhenAllSegmentsCurrent() throws Exception {
213213
admin.handleRequestBody(
214214
req(
215215
CoreAdminParams.ACTION,
216-
CoreAdminParams.CoreAdminAction.UPGRADECOREINDEX.toString(),
216+
CoreAdminParams.CoreAdminAction.UPGRADEINDEX.toString(),
217217
CoreAdminParams.CORE,
218218
coreName),
219219
resp);
@@ -360,7 +360,7 @@ public void testUpgradeCoreIndexFailsWithChildDocuments() throws Exception {
360360
admin.handleRequestBody(
361361
req(
362362
CoreAdminParams.ACTION,
363-
CoreAdminParams.CoreAdminAction.UPGRADECOREINDEX.toString(),
363+
CoreAdminParams.CoreAdminAction.UPGRADEINDEX.toString(),
364364
CoreAdminParams.CORE,
365365
coreName),
366366
resp));
@@ -386,7 +386,7 @@ public void testChildDocsDetection_noChildDocs() throws Exception {
386386
admin.handleRequestBody(
387387
req(
388388
CoreAdminParams.ACTION,
389-
CoreAdminParams.CoreAdminAction.UPGRADECOREINDEX.toString(),
389+
CoreAdminParams.CoreAdminAction.UPGRADEINDEX.toString(),
390390
CoreAdminParams.CORE,
391391
coreName),
392392
resp);
@@ -413,7 +413,7 @@ public void testChildDocsDetection_withChildDocs() throws Exception {
413413
admin.handleRequestBody(
414414
req(
415415
CoreAdminParams.ACTION,
416-
CoreAdminParams.CoreAdminAction.UPGRADECOREINDEX.toString(),
416+
CoreAdminParams.CoreAdminAction.UPGRADEINDEX.toString(),
417417
CoreAdminParams.CORE,
418418
coreName),
419419
resp));

solr/solr-ref-guide/modules/configuration-guide/pages/coreadmin-api.adoc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -780,10 +780,10 @@ This command is used as part of SolrCloud's xref:deployment-guide:shard-manageme
780780
When used against a core in a user-managed cluster without `split.key` parameter, this action will split the source index and distribute its documents alternately so that each split piece contains an equal number of documents.
781781
If the `split.key` parameter is specified then only documents having the same route key will be split from the source index.
782782

783-
[[coreadmin-upgradecoreindex]]
784-
== UPGRADECOREINDEX
783+
[[coreadmin-upgradeindex]]
784+
== UPGRADEINDEX
785785

786-
The `UPGRADECOREINDEX` action upgrades an existing core's index in-place after a Solr major-version upgrade by reindexing documents from older-format segments.
786+
The `UPGRADEINDEX` action upgrades an existing core's index in-place after a Solr major-version upgrade by reindexing documents from older-format segments.
787787
If a core is upgraded by this action, it ensures index compatibility with the next Solr major version (upon a future Solr upgrade) without having to re-create the index from source.
788788

789789
This action is expensive and can take a while to complete on large indexes. Consider running with `async` option in such cases.
@@ -797,7 +797,7 @@ Fields that are neither stored nor docValues-backed will lose their data, unless
797797

798798
It is recommended to test on a copy and have a backup before running on production data.
799799

800-
=== UPGRADECOREINDEX Parameters
800+
=== UPGRADEINDEX Parameters
801801

802802
`core`::
803803
+
@@ -828,7 +828,7 @@ Use <<coreadmin-requeststatus,REQUESTSTATUS>> with the provided `requestid` to p
828828
The update processor chain to use for reindexing.
829829
If omitted, Solr uses the chain configured for the `/update` handler, or the default update chain for the core (in that order).
830830

831-
=== UPGRADECOREINDEX Response
831+
=== UPGRADEINDEX Response
832832

833833
On success, the response includes:
834834

@@ -845,20 +845,20 @@ The number of segments successfully processed.
845845
One of `UPGRADE_SUCCESSFUL` or `NO_UPGRADE_NEEDED`.
846846
On failure, an exception is thrown with error details.
847847

848-
=== UPGRADECOREINDEX Examples
848+
=== UPGRADEINDEX Examples
849849

850850
*Synchronous:*
851851

852852
[source,bash]
853853
----
854-
http://localhost:8983/solr/admin/cores?action=UPGRADECOREINDEX&core=techproducts
854+
http://localhost:8983/solr/admin/cores?action=UPGRADEINDEX&core=techproducts
855855
----
856856

857857
*Asynchronous (recommended for large cores):*
858858

859859
[source,bash]
860860
----
861-
http://localhost:8983/solr/admin/cores?action=UPGRADECOREINDEX&core=techproducts&async=upgrade_1
861+
http://localhost:8983/solr/admin/cores?action=UPGRADEINDEX&core=techproducts&async=upgrade_1
862862
----
863863

864864
Then poll status:

solr/solrj/src/java/org/apache/solr/common/params/CoreAdminParams.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public enum CoreAdminAction {
179179
CREATESNAPSHOT,
180180
DELETESNAPSHOT,
181181
LISTSNAPSHOTS,
182-
UPGRADECOREINDEX;
182+
UPGRADEINDEX;
183183

184184
public final boolean isRead;
185185

0 commit comments

Comments
 (0)