wiki:proposals/readonly

Version 1 (modified by heikki, 11 years ago) ( diff )

--

GeoNetwork on a read-only database

Date 2013-01-22
Contact(s) Heikki Doeleman
Status Being discussed, in progress, initial implementation in progress
Assigned to release 2.9.x
Resources Available
Ticket # #TBD
Github dev branch https://github.com/heikkidoeleman/core-geonetwork/tree/eeareadonly

Overview

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.

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.

Proposal Type

  • Type: Back-end change, GUI change
  • App: GeoNetwork
  • Module: main, web-client
  • Documents:

Voting History

  • Vote not yet proposed.

Motivations

Proposal

services

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.

harvesters

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.

determining read-only status

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.

GUI

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.

Backwards Compatibility Issues

None.

New libraries added

None.

Risks

Everything involves some element of risk....

Participants

  • Heikki Doeleman
  • Francois Prunayre

Attachments (1)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.