Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SOLR-17469: CLI: Resolve -f flag conflicts #2740

Merged
merged 8 commits into from
Oct 5, 2024
Merged

Conversation

epugh
Copy link
Contributor

@epugh epugh commented Oct 3, 2024

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

Description

Keep -f for forcing actions since it is often used in other tools for "force" as well. This means keep -f for force in bin/solr and RunExampleTool to allow starting Solr as root user and also for force deleting configuration directories in DeleteTool.

Deprecate (9x) and remove (10.0) by replacing the "force-delete-config" (--force-delete-config, -forceDeleteConfig, --forceDeleteConfig, -f) in DeleteTool with the "force" option ( --force, -f).

Deprecate (9x) and remove (10.0) -f from the "format" option in PostTool.

Deprecate (9x) and remove (10.0) -f from the "config file" option (-f, --config-file, -config-file) in SolrExporter.

Deprecate (9x) and remove (10.0) -f from "upgrade solr" in install_solr_service.sh by replacing it with "–upgrade".

Solution

what it says

Tests

Please describe the tests you've developed or run to confirm this patch implements the feature or solves the problem.

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

-f means Force, and when I read what this does, by overwriting things, that seems to meet the definition of -f, so instead of changing the parameter, I tweaked the description.
@github-actions github-actions bot added documentation Improvements or additions to documentation start-scripts prometheus-exporter labels Oct 3, 2024
@epugh
Copy link
Contributor Author

epugh commented Oct 3, 2024

@malliaridis would love your review!

Copy link
Contributor

@malliaridis malliaridis left a comment

Choose a reason for hiding this comment

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

Changes look very clean, thanks.

The foreground option that uses currently -f in bin/solr and bin/solr.cmd have not been updated. Are we planning to change that option as well?

And a few more hits I found for -f (config-file, SolrExporter) that should be updated:

  • solr/solr-ref-guide/modules/deployment-guide/pages/monitoring-with-prometheus-and-grafana.adoc
  • solr/prometheus-exporter/bin/solr-exporter.cmd
  • solr/prometheus-exporter/bin/solr-exporter

@@ -46,7 +46,7 @@ print_usage() {
echo " -u User to own the Solr files and run the Solr process as; defaults to solr"
echo " This script will create the specified user account if it does not exist."
echo ""
echo " -f Upgrade Solr. Overwrite symlink and init script of previous installation."
echo " -f Force upgrade of Solr. Overwrite symlink and init script of previous installation."
Copy link
Contributor

Choose a reason for hiding this comment

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

Does -f stand for force in this context? Because I don't see any forcing action and the below message is printed in case of an error when -f is used:

/etc/systemd/system/$SOLR_SERVICE.service already exists! Perhaps Solr is already setup as a service on this host? To upgrade Solr use the -f option.

This seems a bit misleading and may require clarification.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe part of this is I don't want to touch the install service ;-). Do we have another bug? Because it appears that you tried to upgrade with a -f, it failed, and told you to use -f ????

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I was thinking if it is easy enough to migrate the file to a Java class as well, but that's another topic. For now it's fine if we don't touch it and just be aware of its existence.

Do we have another bug? Because it appears that you tried to upgrade with a -f, it failed, and told you to use -f ????

I'm not sure how it should behave in case of -f and if it actually stands for upgrade, force or both. It looks like the action taken is a simple upgrade, but the param should be something like --upgrade, instead of -f. In that case the message would make sense. Failing to upgrade would tell the user to force the action with -f/--force.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i am also somewhat thinking that maybe we don't touch install_solr_service.sh.. it's only run once, it has no tests, and I'm somewhat leery of taking it on. What if we finish all the flag conflicts in the bin/solr area, and then, in a seperate ticket, we go back and fix up install_solr_service.sh in a single JIRA?

solr/core/src/java/org/apache/solr/cli/DeleteTool.java Outdated Show resolved Hide resolved
@epugh epugh merged commit 08a17da into apache:main Oct 5, 2024
4 of 5 checks passed
epugh added a commit that referenced this pull request Oct 5, 2024
Keep -f for forcing actions since it is often used in other tools for "force" as well. This means keep -f for force in bin/solr and RunExampleTool to allow starting Solr as root user and also for force deleting configuration directories in DeleteTool.
Deprecate (9x) and remove (10.0) by replacing the "force-delete-config" (--force-delete-config, -forceDeleteConfig, --forceDeleteConfig, -f) in DeleteTool with the "force" option ( --force, -f).
Deprecate (9x) and remove (10.0) -f from the "format" option in PostTool.
Deprecate (9x) and remove (10.0) -f from the "config file" option (-f, --config-file, -config-file) in SolrExporter.

(cherry picked from commit 08a17da)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cat:cli documentation Improvements or additions to documentation prometheus-exporter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants