From b59978bc95df60b1aec63e1765a00eaf9d927975 Mon Sep 17 00:00:00 2001 From: Eric Pugh Date: Sun, 15 Feb 2026 08:43:33 -0500 Subject: [PATCH 1/4] Remove deprecated code --- changelog/unreleased/SOLR-18103.yml | 8 +++++++ .../org/apache/solr/core/SolrXmlConfig.java | 24 ------------------- 2 files changed, 8 insertions(+), 24 deletions(-) create mode 100644 changelog/unreleased/SOLR-18103.yml diff --git a/changelog/unreleased/SOLR-18103.yml b/changelog/unreleased/SOLR-18103.yml new file mode 100644 index 000000000000..671972324d47 --- /dev/null +++ b/changelog/unreleased/SOLR-18103.yml @@ -0,0 +1,8 @@ +# See https://github.com/apache/solr/blob/main/dev-docs/changelog.adoc +title: Remove deprecated hiddenSysProps setting under "metrics" in solr.xml. It remains a standard top level config setting. +type: remove # added, changed, fixed, deprecated, removed, dependency_update, security, other +authors: + - name: Eric Pugh +links: + - name: SOLR-18103 + url: https://issues.apache.org/jira/browse/SOLR-18103 diff --git a/solr/core/src/java/org/apache/solr/core/SolrXmlConfig.java b/solr/core/src/java/org/apache/solr/core/SolrXmlConfig.java index 459b58f13c57..f58286f172f9 100644 --- a/solr/core/src/java/org/apache/solr/core/SolrXmlConfig.java +++ b/solr/core/src/java/org/apache/solr/core/SolrXmlConfig.java @@ -165,10 +165,6 @@ public static NodeConfig fromConfig( configBuilder.setBackupRepositoryPlugins( getBackupRepositoryPluginInfos(root.get("backup").getAll("repository"))); configBuilder.setClusterPlugins(getClusterPlugins(loader, root)); - // will be removed in Solr 10, but until then, use it if a - // is not provided under . - // Remove this line in 10.0 - configBuilder.setHiddenSysProps(getHiddenSysProps(root.get("metrics"))); configBuilder.setMetricsConfig(getMetricsConfig(root.get("metrics"))); configBuilder.setCachesConfig(getCachesConfig(loader, root.get("caches"))); configBuilder.setDefaultZkHost(defaultZkHost); @@ -747,26 +743,6 @@ private static Object decodeNullValue(Object o) { return o; } - /** - * Deprecated as of 9.3, will be removed in 10.0 - * - * @param metrics configNode for the metrics - * @return a comma-separated list of hidden Sys Props - */ - @Deprecated(forRemoval = true, since = "9.3") - private static String getHiddenSysProps(ConfigNode metrics) { - ConfigNode p = metrics.get("hiddenSysProps"); - if (!p.exists()) return null; - Set props = new HashSet<>(); - p.forEachChild( - it -> { - if (it.name().equals("str") && StrUtils.isNotNullOrEmpty(it.txt())) - props.add(Pattern.quote(it.txt())); - return Boolean.TRUE; - }); - return String.join(",", props); - } - private static PluginInfo getPluginInfo(ConfigNode cfg) { if (cfg == null || !cfg.exists()) return null; final var pluginInfo = new PluginInfo(cfg, cfg.name(), false, true); From 63291857664abe7a0830fe0d744c223feb7ec0da Mon Sep 17 00:00:00 2001 From: Eric Pugh Date: Sun, 15 Feb 2026 09:36:47 -0500 Subject: [PATCH 2/4] Remove deprecated constructor from SnapShooter Modify ReplicationHandler backup and deletebackup commands to use the proper constructors. Opens the door to these commands being used in the future with non filesystem backup Repos. --- .../solr/handler/ReplicationHandler.java | 38 +++++++++++++++++-- .../org/apache/solr/handler/SnapShooter.java | 20 +--------- .../pages/user-managed-index-replication.adoc | 5 ++- 3 files changed, 40 insertions(+), 23 deletions(-) diff --git a/solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java b/solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java index e803bdd1d6b8..8b367cf8c300 100644 --- a/solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java +++ b/solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java @@ -379,9 +379,37 @@ public boolean abortFetch() { private void deleteSnapshot(ModifiableSolrParams params, SolrQueryResponse rsp) { params.required().get(NAME); + String repoName = params.get(CoreAdminParams.BACKUP_REPOSITORY); String location = params.get(CoreAdminParams.BACKUP_LOCATION); - core.getCoreContainer().assertPathAllowed(location == null ? null : Path.of(location)); - SnapShooter snapShooter = new SnapShooter(core, location, params.get(NAME)); + + // commitName is not documented in ref guide for the backup option. + // copying to here, an dit may be that both are just null? + String commitName = params.get(CoreAdminParams.COMMIT_NAME); + + CoreContainer cc = core.getCoreContainer(); + BackupRepository repo = null; + if (repoName != null) { + repo = cc.newBackupRepository(repoName); + location = repo.getBackupLocation(location); + if (location == null) { + throw new IllegalArgumentException("location is required"); + } + } else { + repo = new LocalFileSystemRepository(); + if (location == null) { + location = core.getDataDir(); + } else { + location = + core.getCoreDescriptor().getInstanceDir().resolve(location).normalize().toString(); + } + } + if ("file".equals(repo.createURI("x").getScheme())) { + core.getCoreContainer().assertPathAllowed(Path.of(location)); + } + + URI locationUri = repo.createDirectoryURI(location); + SnapShooter snapShooter = + new SnapShooter(repo, core, locationUri, params.get(NAME), commitName); snapShooter.validateDeleteSnapshot(); snapShooter.deleteSnapAsync(this); rsp.add(STATUS, OK_STATUS); @@ -1505,7 +1533,11 @@ public void postCommit() { if (numberToKeep < 1) { numberToKeep = Integer.MAX_VALUE; } - SnapShooter snapShooter = new SnapShooter(core, null, null); + + URI locationUri = Path.of(core.getDataDir()).toUri(); + + SnapShooter snapShooter = + new SnapShooter(new LocalFileSystemRepository(), core, locationUri, null, null); snapShooter.validateCreateSnapshot(); snapShooter.createSnapAsync(numberToKeep, (nl) -> snapShootDetails = nl); } catch (Exception e) { diff --git a/solr/core/src/java/org/apache/solr/handler/SnapShooter.java b/solr/core/src/java/org/apache/solr/handler/SnapShooter.java index 4fe1f0c74272..b971543a70ab 100644 --- a/solr/core/src/java/org/apache/solr/handler/SnapShooter.java +++ b/solr/core/src/java/org/apache/solr/handler/SnapShooter.java @@ -45,7 +45,6 @@ import org.apache.solr.core.SolrCore; import org.apache.solr.core.backup.repository.BackupRepository; import org.apache.solr.core.backup.repository.BackupRepository.PathType; -import org.apache.solr.core.backup.repository.LocalFileSystemRepository; import org.apache.solr.core.snapshots.SolrSnapshotMetaDataManager; import org.apache.solr.handler.api.V2ApiUtils; import org.slf4j.Logger; @@ -67,22 +66,6 @@ public class SnapShooter { private BackupRepository backupRepo = null; private String commitName; // can be null - @Deprecated - public SnapShooter(SolrCore core, String location, String snapshotName) { - String snapDirStr = null; - // Note - This logic is only applicable to the usecase where a shared file-system is exposed via - // local file-system interface (primarily for backwards compatibility). For other use-cases, - // users will be required to specify "location" where the backup should be stored. - if (location == null) { - snapDirStr = core.getDataDir(); - } else { - snapDirStr = - core.getCoreDescriptor().getInstanceDir().resolve(location).normalize().toString(); - } - initialize( - new LocalFileSystemRepository(), core, Path.of(snapDirStr).toUri(), snapshotName, null); - } - public SnapShooter( BackupRepository backupRepo, SolrCore core, @@ -245,8 +228,7 @@ public static IndexCommit getAndSaveNamedIndexCommit(SolrCore solrCore, String c + solrCore.getName()); } - public void createSnapAsync(final int numberToKeep, Consumer> result) - throws IOException { + public void createSnapAsync(final int numberToKeep, Consumer> result) { // TODO should use Solr's ExecutorUtil new Thread( () -> { diff --git a/solr/solr-ref-guide/modules/deployment-guide/pages/user-managed-index-replication.adoc b/solr/solr-ref-guide/modules/deployment-guide/pages/user-managed-index-replication.adoc index 353fdcf598ab..ea3f0f376747 100644 --- a/solr/solr-ref-guide/modules/deployment-guide/pages/user-managed-index-replication.adoc +++ b/solr/solr-ref-guide/modules/deployment-guide/pages/user-managed-index-replication.adoc @@ -518,7 +518,7 @@ The snapshot will be created in a directory called `snapshot.` within the By default the name is generated using date in `yyyyMMddHHmmssSSS` format. If the `location` parameter is passed, that would be used instead of the data directory. -`repository`::: The name of the backup repository to use +`repository`::: The name of the backup repository to use. When not specified, it defaults to local file system. `location`::: Backup location. @@ -569,6 +569,9 @@ There are two supported parameters: `name`::: The name of the snapshot. A snapshot with the name `snapshot._name_` must exist or an error will be returned. +`repository`::: The name of the backup repository to use. + When not specified, it defaults to local file system. + `location`::: The location where the snapshot is created. From f1972cfe79b5cb471fce52f1c57af2ddf9b01e59 Mon Sep 17 00:00:00 2001 From: Eric Pugh Date: Sun, 15 Feb 2026 09:43:05 -0500 Subject: [PATCH 3/4] Revert "Remove deprecated constructor from SnapShooter" This reverts commit 63291857664abe7a0830fe0d744c223feb7ec0da. --- .../solr/handler/ReplicationHandler.java | 38 ++----------------- .../org/apache/solr/handler/SnapShooter.java | 20 +++++++++- .../pages/user-managed-index-replication.adoc | 5 +-- 3 files changed, 23 insertions(+), 40 deletions(-) diff --git a/solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java b/solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java index 8b367cf8c300..e803bdd1d6b8 100644 --- a/solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java +++ b/solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java @@ -379,37 +379,9 @@ public boolean abortFetch() { private void deleteSnapshot(ModifiableSolrParams params, SolrQueryResponse rsp) { params.required().get(NAME); - String repoName = params.get(CoreAdminParams.BACKUP_REPOSITORY); String location = params.get(CoreAdminParams.BACKUP_LOCATION); - - // commitName is not documented in ref guide for the backup option. - // copying to here, an dit may be that both are just null? - String commitName = params.get(CoreAdminParams.COMMIT_NAME); - - CoreContainer cc = core.getCoreContainer(); - BackupRepository repo = null; - if (repoName != null) { - repo = cc.newBackupRepository(repoName); - location = repo.getBackupLocation(location); - if (location == null) { - throw new IllegalArgumentException("location is required"); - } - } else { - repo = new LocalFileSystemRepository(); - if (location == null) { - location = core.getDataDir(); - } else { - location = - core.getCoreDescriptor().getInstanceDir().resolve(location).normalize().toString(); - } - } - if ("file".equals(repo.createURI("x").getScheme())) { - core.getCoreContainer().assertPathAllowed(Path.of(location)); - } - - URI locationUri = repo.createDirectoryURI(location); - SnapShooter snapShooter = - new SnapShooter(repo, core, locationUri, params.get(NAME), commitName); + core.getCoreContainer().assertPathAllowed(location == null ? null : Path.of(location)); + SnapShooter snapShooter = new SnapShooter(core, location, params.get(NAME)); snapShooter.validateDeleteSnapshot(); snapShooter.deleteSnapAsync(this); rsp.add(STATUS, OK_STATUS); @@ -1533,11 +1505,7 @@ public void postCommit() { if (numberToKeep < 1) { numberToKeep = Integer.MAX_VALUE; } - - URI locationUri = Path.of(core.getDataDir()).toUri(); - - SnapShooter snapShooter = - new SnapShooter(new LocalFileSystemRepository(), core, locationUri, null, null); + SnapShooter snapShooter = new SnapShooter(core, null, null); snapShooter.validateCreateSnapshot(); snapShooter.createSnapAsync(numberToKeep, (nl) -> snapShootDetails = nl); } catch (Exception e) { diff --git a/solr/core/src/java/org/apache/solr/handler/SnapShooter.java b/solr/core/src/java/org/apache/solr/handler/SnapShooter.java index b971543a70ab..4fe1f0c74272 100644 --- a/solr/core/src/java/org/apache/solr/handler/SnapShooter.java +++ b/solr/core/src/java/org/apache/solr/handler/SnapShooter.java @@ -45,6 +45,7 @@ import org.apache.solr.core.SolrCore; import org.apache.solr.core.backup.repository.BackupRepository; import org.apache.solr.core.backup.repository.BackupRepository.PathType; +import org.apache.solr.core.backup.repository.LocalFileSystemRepository; import org.apache.solr.core.snapshots.SolrSnapshotMetaDataManager; import org.apache.solr.handler.api.V2ApiUtils; import org.slf4j.Logger; @@ -66,6 +67,22 @@ public class SnapShooter { private BackupRepository backupRepo = null; private String commitName; // can be null + @Deprecated + public SnapShooter(SolrCore core, String location, String snapshotName) { + String snapDirStr = null; + // Note - This logic is only applicable to the usecase where a shared file-system is exposed via + // local file-system interface (primarily for backwards compatibility). For other use-cases, + // users will be required to specify "location" where the backup should be stored. + if (location == null) { + snapDirStr = core.getDataDir(); + } else { + snapDirStr = + core.getCoreDescriptor().getInstanceDir().resolve(location).normalize().toString(); + } + initialize( + new LocalFileSystemRepository(), core, Path.of(snapDirStr).toUri(), snapshotName, null); + } + public SnapShooter( BackupRepository backupRepo, SolrCore core, @@ -228,7 +245,8 @@ public static IndexCommit getAndSaveNamedIndexCommit(SolrCore solrCore, String c + solrCore.getName()); } - public void createSnapAsync(final int numberToKeep, Consumer> result) { + public void createSnapAsync(final int numberToKeep, Consumer> result) + throws IOException { // TODO should use Solr's ExecutorUtil new Thread( () -> { diff --git a/solr/solr-ref-guide/modules/deployment-guide/pages/user-managed-index-replication.adoc b/solr/solr-ref-guide/modules/deployment-guide/pages/user-managed-index-replication.adoc index ea3f0f376747..353fdcf598ab 100644 --- a/solr/solr-ref-guide/modules/deployment-guide/pages/user-managed-index-replication.adoc +++ b/solr/solr-ref-guide/modules/deployment-guide/pages/user-managed-index-replication.adoc @@ -518,7 +518,7 @@ The snapshot will be created in a directory called `snapshot.` within the By default the name is generated using date in `yyyyMMddHHmmssSSS` format. If the `location` parameter is passed, that would be used instead of the data directory. -`repository`::: The name of the backup repository to use. +`repository`::: The name of the backup repository to use When not specified, it defaults to local file system. `location`::: Backup location. @@ -569,9 +569,6 @@ There are two supported parameters: `name`::: The name of the snapshot. A snapshot with the name `snapshot._name_` must exist or an error will be returned. -`repository`::: The name of the backup repository to use. - When not specified, it defaults to local file system. - `location`::: The location where the snapshot is created. From a5adaac8f07df0c831b088136fd2574154c36f1f Mon Sep 17 00:00:00 2001 From: Eric Pugh Date: Sun, 15 Feb 2026 09:45:59 -0500 Subject: [PATCH 4/4] typo] --- changelog/unreleased/SOLR-18103.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/unreleased/SOLR-18103.yml b/changelog/unreleased/SOLR-18103.yml index 671972324d47..2e057434a8f8 100644 --- a/changelog/unreleased/SOLR-18103.yml +++ b/changelog/unreleased/SOLR-18103.yml @@ -1,6 +1,6 @@ # See https://github.com/apache/solr/blob/main/dev-docs/changelog.adoc title: Remove deprecated hiddenSysProps setting under "metrics" in solr.xml. It remains a standard top level config setting. -type: remove # added, changed, fixed, deprecated, removed, dependency_update, security, other +type: removed # added, changed, fixed, deprecated, removed, dependency_update, security, other authors: - name: Eric Pugh links: