Emma Park activity https://gitlab.com/emmaspark 2026-03-14T05:19:40Z tag:gitlab.com,2026-03-14:5203555665 Emma Park commented on issue #588805 at GitLab.org / GitLab 2026-03-14T05:19:40Z emmaspark Emma Park [email protected]

Hello @andrevr 👋 This issue is slipping to 18.11. Two remaining MRs are in review now.

Write part: !225833 Read part: !225826

tag:gitlab.com,2026-03-14:5203548058 Emma Park commented on issue #592642 at GitLab.org / GitLab 2026-03-14T05:10:52Z emmaspark Emma Park [email protected]

Hello @andrevr. I think we should add this to the 18.11 milestone unless we're already at a full capacity. I created a draft backport MR.

tag:gitlab.com,2026-03-14:5203545992 Emma Park commented on issue #592642 at GitLab.org / GitLab 2026-03-14T05:08:18Z emmaspark Emma Park [email protected]

Hello @FIL0003 Thank you for sharing the details! Yes, that error occurred because the trigger doesn't know how to handle the conflict, as @l.rosa mentioned. However, I'm not sure why the AFTER trigger fired when the first INSERT didn't actually do anything. As far as I know, that’s usually how BEFORE triggers behave. Thanks!

tag:gitlab.com,2026-03-14:5203540850 Emma Park commented on merge request !225833 at GitLab.org / GitLab 2026-03-14T05:02:08Z emmaspark Emma Park [email protected]

Hello @hustewart Thank you! I'll be on PTO for the next two weeks, so I'll check that out when I get back. 👍

tag:gitlab.com,2026-03-13:5201304655 Emma Park commented on merge request !225833 at GitLab.org / GitLab 2026-03-13T13:03:05Z emmaspark Emma Park [email protected]

Hello @vyaklushin can you please take another look? Thanks!

tag:gitlab.com,2026-03-13:5200684182 Emma Park pushed to project branch fix-trigger-unique-violation at GitLab.org / GitLab 2026-03-13T10:30:49Z emmaspark Emma Park [email protected]

Emma Park (f84ec2ff) at 13 Mar 10:30

Fix PG::UniqueViolation in project_daily_statistics sync trigger

tag:gitlab.com,2026-03-13:5200486933 Emma Park pushed to project branch fix-trigger-unique-violation at GitLab.org / GitLab 2026-03-13T09:45:38Z emmaspark Emma Park [email protected]

Emma Park (9770ae52) at 13 Mar 09:45

Fix PG::UniqueViolation in project_daily_statistics sync trigger

tag:gitlab.com,2026-03-13:5200462515 Emma Park opened merge request !227227: [Backport 18.8]Fix PG::UniqueViolation in project_daily_statistics sync trigger at GitLab.org / GitLab 2026-03-13T09:39:36Z emmaspark Emma Park [email protected]

What does this MR do and why?

Related: #592642

After the project_daily_statistics partitioning table swap in !211916, the sync trigger table_sync_function_c237afdf68() copies writes from the new partitioned table to project_daily_statistics_archived (the original table). The trigger's INSERT branch performs a plain INSERT without conflict handling.

When a row for the same (project_id, date) already exists in the archived table, the trigger raises PG::UniqueViolation, which causes an HTTP 500 on POST /git-upload-pack. This breaks all CI pipeline git clone operations after the first fetch per day per project.

This MR adds ON CONFLICT DO NOTHING to the trigger's INSERT branch, so duplicate rows in the archived table are silently skipped.

Note: This issue only affects 18.8.x. In 18.9, the archived table and trigger were removed entirely in !219031.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

  • This MR is backporting a bug fix, documentation update, or spec fix, previously merged in the default branch.
  • The MR that fixed the bug on the default branch has been deployed to GitLab.com (not applicable for documentation or spec changes).
  • The MR title is descriptive (e.g. "Backport of 'title of default branch MR'"). This is important, since the title will be copied to the patch blog post.
  • Required labels have been applied to this merge request
  • This MR has been approved by a maintainer (only one approval is required).
  • Ensure the e2e:test-on-omnibus-ee job has succeeded, or if it has failed, investigate the failures. If you determine the failures are unrelated, you may proceed. If you need assistance investigating, reach out to a Software Engineer in Test in #s_developer_experience.

Note to the merge request author and maintainer

If you have questions about the patch release process, please:

tag:gitlab.com,2026-03-13:5200436785 Emma Park pushed new project branch fix-trigger-unique-violation at GitLab.org / GitLab 2026-03-13T09:33:13Z emmaspark Emma Park [email protected]

Emma Park (f413d179) at 13 Mar 09:33

Fix PG::UniqueViolation in project_daily_statistics sync trigger

... and 328 more commits

tag:gitlab.com,2026-03-13:5199913987 Emma Park commented on issue #592642 at GitLab.org / GitLab 2026-03-13T07:02:27Z emmaspark Emma Park [email protected]

Hello @l.rosa Thanks for the ping. I think the fix works, but there's one thing I don't understand. The trigger is an after-trigger, so when the parent table receives INSERT and does nothing (because of the conflict: on_duplicate: :skip), why does the after-trigger still fire and try to INSERT into the archived table(the child table)?

tag:gitlab.com,2026-03-13:5199658822 Emma Park pushed to project branch 588805/swtich-write at GitLab.org / GitLab 2026-03-13T04:54:39Z emmaspark Emma Park [email protected]

Emma Park (685317b5) at 13 Mar 04:54

Switch project push rule writes to project_push_rules table

tag:gitlab.com,2026-03-13:5199655366 Emma Park commented on merge request !225833 at GitLab.org / GitLab 2026-03-13T04:52:04Z emmaspark Emma Park [email protected]

Thanks! 👍

tag:gitlab.com,2026-03-13:5199630894 Emma Park pushed to project branch 588805/swtich-write at GitLab.org / GitLab 2026-03-13T04:37:34Z emmaspark Emma Park [email protected]

Emma Park (8e5a9c81) at 13 Mar 04:37

Update importer

tag:gitlab.com,2026-03-13:5199442651 Emma Park pushed to project branch 588805/swtich-write at GitLab.org / GitLab 2026-03-13T02:39:47Z emmaspark Emma Park [email protected]

Emma Park (10270b1e) at 13 Mar 02:39

Use a memoization

tag:gitlab.com,2026-03-13:5199431865 Emma Park commented on merge request !225833 at GitLab.org / GitLab 2026-03-13T02:33:03Z emmaspark Emma Park [email protected]

OMG!! I swear I tested let_it_be_with_reload and it failed. That's why I changed it to let!. Now it works, whaaaat!

tag:gitlab.com,2026-03-13:5199420180 Emma Park pushed to project branch 588805/Switch_remaining_read_call_sites at GitLab.org / GitLab 2026-03-13T02:26:42Z emmaspark Emma Park [email protected]

Emma Park (7be661e7) at 13 Mar 02:26

Switch remaining read call sites to project_push_rules table

tag:gitlab.com,2026-03-13:5199335578 Emma Park commented on merge request !225833 at GitLab.org / GitLab 2026-03-13T01:31:09Z emmaspark Emma Park [email protected]

project.project_setting.update(push_rule: push_rule) is the existing code. I don't think database review is needed.

tag:gitlab.com,2026-03-13:5199323696 Emma Park commented on merge request !224389 at GitLab.org / GitLab 2026-03-13T01:23:16Z emmaspark Emma Park [email protected]

@vyaklushin can you please take another look? Thanks!

Some jobs keep failing but I don't think it's related to my changes. Hopefully they will be resolved before you start your review. 🤞

tag:gitlab.com,2026-03-13:5199319036 Emma Park commented on merge request !225826 at GitLab.org / GitLab 2026-03-13T01:20:41Z emmaspark Emma Park [email protected]

Thanks @vyaklushin I addressed your comments. Can you please take another look? Thanks! 🙏

tag:gitlab.com,2026-03-13:5199316946 Emma Park commented on merge request !225826 at GitLab.org / GitLab 2026-03-13T01:19:40Z emmaspark Emma Park [email protected]

Hello @mrincon thanks for reviewing. I changed the test to use project_push_rule_path(project, push_rule) and it removed your approval. Can you please re-approve it? Thanks!