Open taojing2002 opened 1 year ago
I've given this some thought, and considered the idea of adding a flag to force specific config updates, but the question remains as to when we would remove those flags? So, the only viable solution I can come up with is to have the properties code always read from and (importantly) write to metacat.properties
(instead of site props) when reading/writing the configutil.*
properties. (We already do this for the application.sitePropertiesDir
property, for obvious reasons)
That way, the old functionality is retained (i.e. every time metacat is redeployed, those settings get deleted and the admin has to re-configure).
Let's discuss this further. I think a diagram of the startup sequence would be helpful in the two main deployment scenarios.
We discussed in the backend developers' meeting on 6/13/23.
In summary, @artntek will:
1. As a stopgap ONLY, change the code to write the above properties back to metacat.properties
instead of metacat-site.properties
, in addition to these used by ESS-DIVE:
configutil.upgrade.status=
configutil.upgrade.database.status=
configutil.upgrade.java.status=
configutil.upgrade.solr.status=
2. Summarize our discussion below, and identify some concrete future actions, so we have a strategy for resolving this longer-term, without needing to write to metacat.properties
(which is what we've been trying to avoid)
Changes to the Metacat version (jar file version) requiring a different data structure (schema changes)
Changes to properties (requiring providing a value for a new property)
Changes that require java code to run - eg changing solr schema, or migrating data from local hard drive into hashstore etc.
They are read by script directly from the metacat.properties
text file in order to determine whether upgrades have been carried out successfully, before starting the app:
configutil.upgrade.status=
configutil.upgrade.database.status=
configutil.upgrade.java.status=
configutil.upgrade.solr.status=
Determine which of the properties listed above can be removed completely, along with the accompanying code (eg can we remove skins from metacat, now we have metacatui?
determine how we can either eliminate the need for each of the remaining properties, or eliminate the need for them to be written to metacat.properties instead of metacat-site.properties
Remove the need for the ESS-DIVE-related properties (listed in "CONTEXT, Section B", above) by adding liveness & readiness probes to check when upgrades are finished.
NOTE that in legacy installations, Metacat can be started without a database, and then the database can be configured in the admin pages in order to complete the setup. This is different from k8s deployments, which expect the database to be present at first startup
All the configutil.*
properties default to false
for each deployment (because metacat.properties
is always overwritten).
This forces the operator to visit the admin page, where they first set up the database connection details, thus enabling the next step...
They click "Configure Database", which causes the code to check the app version (from metacat.properties
) against the database version (from the db_version
table - now that the app has access)
The app then sees the need for DB upgrade, and presents the operator with an "upgrade" button.
Manual intervention (i.e. clicking the button) runs the upgrade
Check the app/jar version (2.19) against the DB version (2.18) upon startup
If an upgrade is needed, set configutil.databaseConfigured=false
in metacat-site.properties
. (Note this is different from before, because the value is written in response to the code actually having identified a need for upgrade.)
The resulting action is:
configutil.databaseConfigured=false
forces the operator to visit the database configuration admin page and click the "upgrade" button to run the upgrade, as before. configutil.databaseConfigured=false
simply causes the upgrade to run automatically.@mbjones and @taojing2002 - I've summarized above what I remembered from our discussion (from here onwards). I'd love to hear your feedback and corrections, and I'd particularly appreciate @mbjones editing the SPECIFIC VERSIONING EXAMPLE section, since I'm not sure I've done it justice. Thanks!
this is now resolved by a workaround (see #1664), but needs a longer-term solution that cleans up these properties and obviates the need for writing to metacat.properties
instead of metacat-site.properties
. Repeating this section from above, for clarity:
[ ] Determine which of https://github.com/NCEAS/metacat/issues/1638#issue-1748636134 can be removed completely, along with the accompanying code (eg can we remove skins from metacat, now we have metacatui?
[ ] determine how we can either eliminate the need for each of the remaining properties, or eliminate the need for them to be written to metacat.properties instead of metacat-site.properties
[ ] Remove the need for the ESS-DIVE-related properties (listed in "CONTEXT, Section B", above) by adding liveness & readiness probes to check when upgrades are finished.
THIS IS AN EPIC Related Issues:
#1664================================================
Before we introduced the metacat-site.properties, we used those properties in the metacat.properties file to force operators to go through admin pages:
If values of any above of those properties are not
bypassed
ortrue
, Metacat can't be functional. So operators have to go through the admin pages. Sometimes this approach is overkilling when we do NOT need to change anything during a re-deployment.Now, those properties are stored in the metacat-site.properties file. Once they were set the values
true
orbypassed
in the metacat-site.properties file, Metacat can function without going through the admin page after a new deployment. That may lead Metacat skip a critical update process.We need a way to signal/force operators to run the admin pages when it is necessary.