Drop auction_prices table - #4852
Conversation
|
Reminder: Please update the DB Readme and comment whether migrations are reversible (include rollback scripts if applicable).
Caused by: |
|
Claude finished @jmg-duarte's task in 1m 15s —— View job PR Review: Drop
|
| @@ -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; | |||
There was a problem hiding this comment.
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:51→database::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 atry_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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
Description
Drops the now unused auction prices table, replaced by competition auctions, should save ~370GB (at least)
Changes
auction_pricestable