exist icon indicating copy to clipboard operation
exist copied to clipboard

Feature request: do not fire triggers on restore

Open wshager opened this issue 11 years ago • 8 comments

When restoring, "create" and/or "update" triggers should NOT fire, since documents aren't actually created or updated, merely read back from a previous state.

wshager avatar Oct 01 '14 10:10 wshager

Actually, I think we could achieve the same outcome but with a revision to the request. How about instead:

The Triggers API should be enhanced so that a Trigger is aware if it is firing due to the restore of a Backup. Triggers can then decide whether they are interested or not in responding to events during a restore. Existing Triggers should be appropriately updated to take this into account.

adamretter avatar Oct 01 '14 10:10 adamretter

yes @wolfgang and I have been talking about this; this is the design we (I) had in mind.

dizzzz avatar Oct 01 '14 11:10 dizzzz

I agree it would be useful for triggers to be aware of events during a restore procedure vs regular operation.

Also, the same thing would also be useful for some indexes, to allow them to be disabled during a restore (as the index may rely on information in the database that is not yet present). Granted this means a re-index would need to be performed after the restore, but it would be better than the alternative.

caseydawsonjordan avatar Oct 19 '15 17:10 caseydawsonjordan

What is the progress on this? My thinking on this is, as a rule of thumb. the provision of eXist service-like features e.g. triggers, indexing and scheduler should apart from their initial configuration should have associated to functions

  • to enable or disable the in place configuration
  • to start or stop the enabled (registered) service

So although the configuration is in place unless enabled, the service wont start on boot. Once enabled the service will start on boot, unless disabled. When the service, is running you can start or stop it to do something like backups. The above approach is pretty much how systemd works.

The approach that the comes closest to this in the restXQ exrest module, where the service won't be enabled until you register it

exrest:deregister-module($module as xs:anyURI) exrest:register-module($module as xs:anyURI)

grantmacken avatar Jan 21 '19 00:01 grantmacken

AFAIK there is no progress.

adamretter avatar Jan 21 '19 02:01 adamretter

related PR #3338

line-o avatar Apr 08 '20 15:04 line-o

@line-o I don't think #3338 is really related to this.

adamretter avatar Apr 08 '20 15:04 adamretter

I am pretty sure that some triggers are not fired during restore (e.g. replication)

dizzzz avatar Apr 09 '20 12:04 dizzzz