[PR #13942] [MERGED] 12336 make region API calls atomic #14283

Closed
opened 2025-12-29 23:23:35 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/13942
Author: @arthanson
Created: 10/2/2023
Status: Merged
Merged: 10/17/2023
Merged by: @jeremystretch

Base: developHead: 12336-serialize-region-api


📝 Commits (7)

  • e038e6a 12336 make region API calls atomic
  • b1d8acd 12336 switch to pg locks
  • 495b15b Merge branch 'develop' into 12336-serialize-region-api
  • e9c447a 12336 add locks to all views using mptt models
  • 960e64c 12336 fix ADVISORY_LOCK_KEYS reference
  • 870b1fa 12336 review changes
  • 537ef80 Tweak advisory lock numbering

📊 Changes

6 files changed (+43 additions, -12 deletions)

View changed files

📝 netbox/dcim/api/views.py (+6 -6)
📝 netbox/netbox/api/viewsets/__init__.py (+21 -0)
📝 netbox/netbox/constants.py (+11 -0)
📝 netbox/tenancy/api/views.py (+3 -3)
📝 netbox/wireless/api/views.py (+2 -2)
📝 netbox/wireless/models.py (+0 -1)

📄 Description

Fixes: #12336

added mixin to put pglocks (for MPTT) around view calls to create, update, destroy. used the model name for the lock key (instead of a common 'mptt' one) so parallel calls could be made to different mptt objects (say sitegroups and regions) for better performance.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/13942 **Author:** [@arthanson](https://github.com/arthanson) **Created:** 10/2/2023 **Status:** ✅ Merged **Merged:** 10/17/2023 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `12336-serialize-region-api` --- ### 📝 Commits (7) - [`e038e6a`](https://github.com/netbox-community/netbox/commit/e038e6ac401642f722edb044934051412ee91328) 12336 make region API calls atomic - [`b1d8acd`](https://github.com/netbox-community/netbox/commit/b1d8acd72281965028248b7140b7573789f805b2) 12336 switch to pg locks - [`495b15b`](https://github.com/netbox-community/netbox/commit/495b15b291cb722ffda512c31ba4f40b9cb7de30) Merge branch 'develop' into 12336-serialize-region-api - [`e9c447a`](https://github.com/netbox-community/netbox/commit/e9c447ad92a5658914bc0eb0424d39c1fba4202d) 12336 add locks to all views using mptt models - [`960e64c`](https://github.com/netbox-community/netbox/commit/960e64c3654e97af85e25a7095cba083f791de64) 12336 fix ADVISORY_LOCK_KEYS reference - [`870b1fa`](https://github.com/netbox-community/netbox/commit/870b1fabe590e7bfb90255930bc427ee82f84188) 12336 review changes - [`537ef80`](https://github.com/netbox-community/netbox/commit/537ef80bde944fd611a776e2564b3240af474fdf) Tweak advisory lock numbering ### 📊 Changes **6 files changed** (+43 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `netbox/dcim/api/views.py` (+6 -6) 📝 `netbox/netbox/api/viewsets/__init__.py` (+21 -0) 📝 `netbox/netbox/constants.py` (+11 -0) 📝 `netbox/tenancy/api/views.py` (+3 -3) 📝 `netbox/wireless/api/views.py` (+2 -2) 📝 `netbox/wireless/models.py` (+0 -1) </details> ### 📄 Description ### Fixes: #12336 added mixin to put pglocks (for MPTT) around view calls to create, update, destroy. used the model name for the lock key (instead of a common 'mptt' one) so parallel calls could be made to different mptt objects (say sitegroups and regions) for better performance. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 23:23:35 +01:00
adam closed this issue 2025-12-29 23:23:36 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#14283