Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove view_recalc_queue and related triggers #2220

Open
lampajr opened this issue Dec 16, 2024 · 0 comments · May be fixed by #2203
Open

Remove view_recalc_queue and related triggers #2220

lampajr opened this issue Dec 16, 2024 · 0 comments · May be fixed by #2203
Assignees
Labels
Milestone

Comments

@lampajr
Copy link
Member

lampajr commented Dec 16, 2024

Feature idea.

Right now Horreum has still some db triggers that we should move into Horreum business logic. Some of them are related to view_recalc_queue which is indeed updated only through triggers in the database.

This can cause some race conditions (noticed just because one of the racing flows was wrong).

Affected entities:

event_object_table trigger_name event_manipulation action_statement action_timing
label_values dsv_after_insert INSERT EXECUTE FUNCTION dsv_after_lv_insert_func() AFTER
view_recalc_queue recalc_dataset_view INSERT EXECUTE FUNCTION recalc_dataset_view() AFTER
viewcomponent dsv_after_update UPDATE EXECUTE FUNCTION dsv_after_vc_update_func() AFTER
viewcomponent dsv_after_update INSERT EXECUTE FUNCTION dsv_after_vc_update_func() AFTER
viewcomponent dsv_after_delete DELETE EXECUTE FUNCTION dsv_after_vc_delete_func() AFTER

Describe the solution you'd like

Move the logic that updates the dataset_view table and related into Horreum, i.e., do NOT rely on database triggers.

Remove the following db entities:

  • Remove view_recalc_queue table
  • Remove trigger dsv_after_delete and related function dsv_after_vc_delete_func
  • Remove trigger dsv_after_update and related function dsv_after_vc_update_func
  • Remove trigger recalc_dataset_view and related function recalc_dataset_view
  • Remove trigger dsv_after_insert and related function dsv_after_lv_insert_func
  • The removed db logic should be migrated into the Horreum business logic

Additional information

n/a

@lampajr lampajr self-assigned this Dec 16, 2024
@lampajr lampajr linked a pull request Dec 16, 2024 that will close this issue
4 tasks
@lampajr lampajr added this to the 0.17 Release milestone Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant