[PR #2296] [MERGED] Add SavePeer method to prevent a possible account inconsistency #14940

Closed
opened 2026-08-05 03:06:39 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/2296
Author: @mlsmaycon
Created: 7/21/2024
Status: Merged
Merged: 7/26/2024
Merged by: @mlsmaycon

Base: mainHead: fix/possible-account-inconsistency


📝 Commits (3)

  • e8a8767 Add SavePeer method to prevent a possible account inconsistency
  • 2550c5c add consts for reused condition and log format
  • 0532a72 merge var declaration

📊 Changes

5 files changed (+116 additions, -10 deletions)

View changed files

📝 management/server/file_store.go (+20 -0)
📝 management/server/peer.go (+3 -2)
📝 management/server/sql_store.go (+41 -7)
📝 management/server/sql_store_test.go (+49 -0)
📝 management/server/store.go (+3 -1)

📄 Description

Describe your changes

SyncPeer was storing the account with a simple read lock

This change introduces the SavePeer method to the store to be used in these cases

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

🔄 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/netbirdio/netbird/pull/2296 **Author:** [@mlsmaycon](https://github.com/mlsmaycon) **Created:** 7/21/2024 **Status:** ✅ Merged **Merged:** 7/26/2024 **Merged by:** [@mlsmaycon](https://github.com/mlsmaycon) **Base:** `main` ← **Head:** `fix/possible-account-inconsistency` --- ### 📝 Commits (3) - [`e8a8767`](https://github.com/netbirdio/netbird/commit/e8a8767807c27c6748d746d1826ba05a9e91ae14) Add SavePeer method to prevent a possible account inconsistency - [`2550c5c`](https://github.com/netbirdio/netbird/commit/2550c5c45fdd8cfb6b75cc16a4f249e0a54805f5) add consts for reused condition and log format - [`0532a72`](https://github.com/netbirdio/netbird/commit/0532a72e9ae5e71fd0ef7679527cee23e5c56bc2) merge var declaration ### 📊 Changes **5 files changed** (+116 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `management/server/file_store.go` (+20 -0) 📝 `management/server/peer.go` (+3 -2) 📝 `management/server/sql_store.go` (+41 -7) 📝 `management/server/sql_store_test.go` (+49 -0) 📝 `management/server/store.go` (+3 -1) </details> ### 📄 Description ## Describe your changes SyncPeer was storing the account with a simple read lock This change introduces the SavePeer method to the store to be used in these cases ## Issue ticket number and link ### Checklist - [x] Is it a bug fix - [ ] Is a typo/documentation fix - [ ] Is a feature enhancement - [ ] It is a refactor - [ ] Created tests that fail without the change (if possible) - [ ] Extended the README / documentation, if necessary --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 03:06:39 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#14940