Remove triggers from Mahara database
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
Wishlist
|
Unassigned |
Bug Description
I've created a forum post to discuss this:
* https:/
Basically, my reasoning is:
1. Mahara supports two DB types - MySql and Postgres. Each DB has different syntax when it comes to creating/
2. Mahara already has the concept of events in place. We can move the functionality of each trigger into an event. We would then have more control over the event. For example, don't action an event during an upgrade.
3. Triggers make it difficult to see what is actually happening. They are not transparent. If you weren't aware that there is a trigger on the table, it can make it difficult to track down why something is behaving in a certain way.
We can start slowly by removing one at a time. It doesn't have to happen all at once.
Just my thoughts.
Cheers.
Changed in mahara: | |
status: | New → Confirmed |
importance: | Undecided → Wishlist |
Changed in mahara: | |
milestone: | 19.04.0 → 19.10.0 |
Changed in mahara: | |
status: | In Progress → Fix Committed |
tags: | added: nominatedfeature |
Changed in mahara: | |
status: | Fix Committed → Fix Released |
Hi all,
These triggers are causing db dumps to fail (in progresql) due to triggers being constantly deleted and created.
pg_dump -h mydbserver -U myuser mydb > /tmp/test.sql :pg_catalog. regproc AS tgfname, pg_catalog. pg_get_ triggerdef( oid, false) AS tgdef, tgenabled, tableoid, oid FROM pg_catalog. pg_trigger t WHERE tgrelid = '8279073' ::pg_catalog. oid AND NOT tgisinternal
pg_dump: [archiver (db)] query failed: ERROR: cache lookup failed for function 9184443
pg_dump: [archiver (db)] query was: SELECT tgname, tgfoid:
We have a script that will show us which triggers are invalid:
ERROR: cache lookup failed for function 8279073 elasticsearch_ view on table catalyst_ mahara_ demo_stage. view in database mydb is invalid. elasticsearch_ artefact on table mydb.artefact in database mydb is invalid.
CRITICAL: Trigger search_
ERROR: cache lookup failed for function 8279073
CRITICAL: Trigger search_
Can this issue be kicked along a bit, thanks.
Darrin