-
Notifications
You must be signed in to change notification settings - Fork 17
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
Fix admin index page #390
base: master
Are you sure you want to change the base?
Fix admin index page #390
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me, with solr (so ALA is not affected):
and solrcloud:
The only think I see is that the swap button/step will fail for solrcloud. I think that this can be addressed in other PR.
BTW I was solving this in a different and "wip" way:
diff --git a/grails-app/services/au/org/ala/bie/IndexService.groovy b/grails-app/services/au/org/ala/bie/IndexService.groovy
index 752f833..74283f4 100644
--- a/grails-app/services/au/org/ala/bie/IndexService.groovy
+++ b/grails-app/services/au/org/ala/bie/IndexService.groovy
@@ -7,6 +7,7 @@ import grails.config.Config
import grails.core.support.GrailsConfigurationAware
import org.apache.solr.client.solrj.SolrQuery
import org.apache.solr.client.solrj.SolrRequest
+import org.apache.solr.client.solrj.request.CollectionAdminRequest
import org.apache.solr.client.solrj.request.CoreAdminRequest
import org.apache.solr.client.solrj.response.QueryResponse
import org.apache.solr.common.SolrDocument
@@ -24,6 +25,7 @@ class IndexService implements GrailsConfigurationAware {
def offlineSolrClient
def updatingLiveSolrClient
def adminSolrClient
+ def grailsApplication
// Configuration
SolrQuery searchTemplate
@@ -79,18 +81,33 @@ class IndexService implements GrailsConfigurationAware {
}
def swap() {
- log.info("Swapping index")
- CoreAdminRequest car = new CoreAdminRequest()
- car.setCoreName("bie")
- car.setOtherCoreName("bie-offline")
- car.setAction(CoreAdminParams.CoreAdminAction.SWAP)
- car.process(adminSolrClient.client)
+ boolean usingSolrCloud = grailsApplication.config.getProperty('usingSolrCloud', Boolean, false)
+
+ if (usingSolrCloud) {
+ log.info("Not implemented: Swap index in SolrCloud manually")
+ } else {
+ log.info("Swapping index in Solr standalone mode")
+ CoreAdminRequest car = new CoreAdminRequest()
+ car.setCoreName("bie")
+ car.setOtherCoreName("bie-offline")
+ car.setAction(CoreAdminParams.CoreAdminAction.SWAP)
+ car.process(adminSolrClient.client)
+ }
}
Hey @vjrj So based on your comments, I guess that means the Australian living atlas no longer uses Solr, but Elasticsearch? Have you tried the current swapping code with solrcloud yet? But like I said, I haven't really tried that stuff myself. |
I’m not sure what is using ALA currently in prod or testing, but traditionally they used a In our portal we use a single And I didn't try the swap button because I tested the index query in our prod |
Ah I had no idea there was a solr native api for swapping :) Thanks for the info! |
The admin page was broken on our deployment. (500 internal server error cause by a null-pointer reference)
This was caused by our SOLR not using the default core names: bie and bie-offline.
We are running SOLR 8 in "cloud" mode.
That seems to make the collections use strange core name like bie_shard1_replica_n1, etc.
The table, showing the stats for the cores, was using hardcoded core names however.
This change instead remove all expectations for names and simply loops over all cores returned in the status.
Instead of expecting very specific core names to be present in the status call.
So this does alter the behavior, as now all cores will show up.
But it is safer, because not having a bie or bie-offline core will not prevent the page from loading.
If you prefer, I could alway add some logic to filter cores based on a prefix value, e.g. "bie-"