Skip to content

fix: update seq table when migrating table.#4902

Merged
Shubham8287 merged 5 commits intomasterfrom
shub/migrate-table-seq
Apr 27, 2026
Merged

fix: update seq table when migrating table.#4902
Shubham8287 merged 5 commits intomasterfrom
shub/migrate-table-seq

Conversation

@Shubham8287
Copy link
Copy Markdown
Contributor

@Shubham8287 Shubham8287 commented Apr 27, 2026

Description of Changes

MutTxId::add_columns_to_table creates new table but only copies sequences to in-memory state, which causes autoinc columns to reset on restart.

The existing implementation relies on create_table_and_update_seq helper, which only updates the sequence state in memory. This change ensures that the allocation is also persisted to the system table, keeping it consistent across restarts.

API and ABI breaking changes

NA

Expected complexity level and risk

2

Testing

Added a test, which migrate table and checks for autoinc column value without and with restart.

@Shubham8287 Shubham8287 requested a review from Centril April 27, 2026 06:19
Comment thread crates/core/src/db/update.rs Outdated
Comment thread crates/core/src/db/update.rs
Comment thread crates/core/src/db/update.rs
Comment thread crates/core/src/db/update.rs
Comment thread crates/core/src/db/update.rs
Comment thread crates/core/src/db/update.rs Outdated
Comment thread crates/datastore/src/locking_tx_datastore/mut_tx.rs Outdated
Comment thread crates/datastore/src/locking_tx_datastore/sequence.rs Outdated
Comment thread crates/core/src/db/update.rs
Comment thread crates/core/src/db/update.rs
Shubham8287 and others added 3 commits April 27, 2026 14:22
Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>
Signed-off-by: Shubham Mishra <shivam828787@gmail.com>
Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>
Signed-off-by: Shubham Mishra <shivam828787@gmail.com>
@Shubham8287 Shubham8287 requested a review from Centril April 27, 2026 09:07
@Shubham8287 Shubham8287 added this pull request to the merge queue Apr 27, 2026
Merged via the queue into master with commit 4f2c064 Apr 27, 2026
34 checks passed
@Shubham8287 Shubham8287 deleted the shub/migrate-table-seq branch April 27, 2026 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants