20878 use database routing when running script #814

Closed
opened 2026-04-05 17:54:01 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @arthanson on 11/25/2025

Fixes: #20878

Two main changes were needed:

  • The atomic transaction wrapping the script needs to be done on default database and also the branch database as the script could potentially modify data in either. Device was picked as a branch aware model to get the correct db_for_write.
  • The request processor code needs to be run even if not committing in order to pick up the branch processor that actually switches to the branch. However the event_tracking request_processor needs to be skipped so it doesn't process events (like a web hook setup on data being modified).
*Originally created by @arthanson on 11/25/2025* ### Fixes: #20878 Two main changes were needed: * The atomic transaction wrapping the script needs to be done on default database and also the branch database as the script could potentially modify data in either. Device was picked as a branch aware model to get the correct db_for_write. * The request processor code needs to be run even if not committing in order to pick up the branch processor that actually switches to the branch. However the event_tracking request_processor needs to be skipped so it doesn't process events (like a web hook setup on data being modified).
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/netbox#814