Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions database/sql/V124__drop_auction_prices.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- Drop the `auction_prices` table. Its data duplicated the `price_tokens` /
-- `price_values` arrays of `competition_auctions`, which every reader now uses.
DROP TABLE IF EXISTS auction_prices;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Blocker: the table is still being written to. autopilot's save_competition still inserts into auction_prices on every auction:

  • crates/autopilot/src/database/competition.rs:51database::auction_prices::insert(...)INSERT INTO auction_prices (...) (crates/database/src/auction_prices.rs:26)
  • This runs on the run-loop hot path (crates/autopilot/src/run_loop.rs:642), inside a try_join! whose error is propagated with ?.

Once this migration runs, that INSERT will fail with relation "auction_prices" does not exist, rolling back the whole competition-save transaction and failing post-processing for every auction. Because migrations apply before/independently of the new binary rolling out, this breaks autopilot regardless of deploy ordering.

The write path (insert in crates/database/src/auction_prices.rs and its call site in competition.rs) must be removed before or together with dropping the table.

Also note the deprecation comment in crates/database/src/auction_prices.rs:1-3 states the table "can't currently be removed, since the solver team is still using it." If that's stale, please confirm with the solver team (and any analytics/replica consumers) before dropping — otherwise it's an external breakage too.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Interesting. Why did you decide to apply this change on top of main instead of the PR series that actually removes and refactors the related code?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I had to do a bit of git surgery on the other branches, I was just tired of it so I just took the code out and placed it outside. Eventually it gets merged to main anyway

Loading