Skip to content

Conversation

motus
Copy link
Member

@motus motus commented Sep 22, 2025

Pull Request

Title

In PostgreSQL, attempting to insert a record with conflicting keys fails (a benign action in MLOS), fails the entire transaction thus preventing the update of other tables. Splitting the update into two independent transactions solves the problem.


Description

Update tables trial_status and trial in separate transactions (that's OK for MLOS) to make sure PG won't fail the update of trial if there is a duplicate record in trial_status.


Type of Change

  • 🛠️ Bug fix

Testing

Run TQP benchmark with PostgreSQL storage.

…at's OK for MLOS) to make sure PG won't fail the update of

`trial` if there is a duplicate record in `trial_status`
@motus motus self-assigned this Sep 22, 2025
@motus motus requested a review from a team as a code owner September 22, 2025 17:13
@Copilot Copilot AI review requested due to automatic review settings September 22, 2025 17:13
@motus motus added bug Something isn't working ready for review Ready for review mlos-bench labels Sep 22, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a PostgreSQL transaction failure issue where inserting duplicate records in the trial_status table would cause the entire transaction to fail, preventing updates to the trial table. The fix splits the database operations into separate transactions to ensure independence.

  • Separates trial_status and trial table updates into independent transactions
  • Prevents PostgreSQL transaction rollback when duplicate keys are encountered in trial_status

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@motus motus enabled auto-merge (squash) September 22, 2025 17:15
motus and others added 2 commits September 22, 2025 10:16
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working mlos-bench ready for review Ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: PostgreSQL storage crashes when updating the trial status
1 participant