Changes between Version 5 and Version 6 of Ticket #29721, comment 12


Ignore:
Timestamp:
Oct 7, 2026, 2:50:28 AM (4 hours ago)
Author:
Gavin Wahl(vendor)

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #29721, comment 12

    v5 v6  
    1 After #32374, the bug still happens for migrations that use deferred sql (which is a lot, like CreateModel, AlterField...). Maybe BaseDatabaseSchemaEditor needs to take a record_migration callback so it can always be recorded in the atomic block? The deferred_sql check was kind of deeply coupled.
     1After #32374, the bug still happens for migrations that use deferred sql (which is a lot, like CreateModel, AlterField...). Maybe BaseDatabaseSchemaEditor needs to take a record_migration callback so it can always be recorded in the atomic block? Alternatively, it expose a execute_deferred_sql() method and allow the executor to execute and reset the deferred queue before committing. The deferred_sql check was kind of deeply coupled.
    22
    33I believe the most realistic and reliable reproducible reproducer is to simulate a hard crash during migration recording by adding `import os; os.kill(os.getpid(), 9)` or `import sys; sys.exit()` to the first line of BaseDatabaseSchemaEditor.record_migration. A unrecoverable hard crash can happen at any time, that's why we have transactions.
Back to Top