| 1 | = GeoNetwork on a read-only database = |
| 2 | |
| 3 | || '''Date''' || 2013-01-22 || |
| 4 | || '''Contact(s)''' || Heikki Doeleman || |
| 5 | || '''Status''' || Being discussed, in progress, initial implementation in progress || |
| 6 | || '''Assigned to release''' || 2.9.x || |
| 7 | || '''Resources''' || Available || |
| 8 | || '''Ticket #''' || #TBD || |
| 9 | || '''Github dev branch ''' || https://github.com/heikkidoeleman/core-geonetwork/tree/eeareadonly || |
| 10 | |
| 11 | == Overview == |
| 12 | |
| 13 | This proposal aims to improve GeoNetwork's behaviour when it is running on a read-only database. A use case for this is that some users wish to set up their DBMS in a master/slave cluster, where the slave is read-only. When the master fails, the slave is automatically activated but is not automatically no longer read-only. |
| 14 | |
| 15 | Without the changes in this proposal GeoNetwork, in such a scenario, would keep trying to write to the database, both behind the screens (e.g. periodic harvesters) or in response to user interaction (e.g. view a metadata, its popularity is increased). This leads to exceptions that slow the system down and further reduce the user experience by returning error responses. |
| 16 | |
| 17 | |
| 18 | === Proposal Type === |
| 19 | * '''Type''': Back-end change, GUI change |
| 20 | * '''App''': !GeoNetwork |
| 21 | * '''Module''': main, web-client |
| 22 | |
| 23 | === Links === |
| 24 | * '''Documents''': |
| 25 | |
| 26 | === Voting History === |
| 27 | * Vote not yet proposed. |
| 28 | |
| 29 | == Motivations == |
| 30 | |
| 31 | == Proposal == |
| 32 | |
| 33 | === services === |
| 34 | |
| 35 | A new abstract class !NotInReadOnlyModeService is introduced, which will be the base class of all services that do CUD (create, update, delete) operations on the DB. This class implements Jeeves' Service as do all services. It's {{{exec()}}} method checks whether GeoNetwork is running in read-only mode and if so, it does nothing. If not, it delegates to {{{serviceSpecificExec()}}}, where the affected services should put their normal (non-read-only) execution code. |
| 36 | |
| 37 | === harvesters === |
| 38 | |
| 39 | When !HarvesterManager is initialized, it takes GN's read-only mode status from the !GeonetContext. If it is in read-only mode, harvester operations {{{run}}} (periodic) and {{{invoke}}} (user-instigated) do nothing. |
| 40 | |
| 41 | === determining read-only status === |
| 42 | |
| 43 | Currently this is determined by the presence of a configuration parameter in config.xml. As we speak, we're investigating how to improve on this so its status can be adapted dynamically in the event the database becomes read-only, so no restart of GeoNetwork is necessary. |
| 44 | |
| 45 | === GUI === |
| 46 | |
| 47 | It is recommended that the GN GUI does not display any link to a service that is culled in a read-only situation. This proposal includes doing that in (one of the) Ext GUIs; seeing the sprawl of different GUIs, we'll do it in one of them only. |
| 48 | |
| 49 | |
| 50 | === Backwards Compatibility Issues === |
| 51 | |
| 52 | None. |
| 53 | |
| 54 | === New libraries added === |
| 55 | |
| 56 | None. |
| 57 | |
| 58 | == Risks == |
| 59 | |
| 60 | Everything involves some element of risk.... |
| 61 | |
| 62 | == Participants == |
| 63 | |
| 64 | * Heikki Doeleman |
| 65 | * Francois Prunayre |