mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-11-02 19:25:05 +03:00
fix(node): let a node take back a client orphaned before the upgrade
The migration backfills sync_orphaned_by = 0 for every client a node merge had already soft-orphaned, and the gate refused a detached record unless its mark named the reporting node. A client inside its orphan grace window at upgrade time was therefore refused when its node reported it again, and ReapSyncOrphans then deleted it on the master while the node kept serving it. A mark that names no node predates the column and may be taken back by any node, as before.
This commit is contained in:
@@ -160,7 +160,8 @@ func loadNodeClientClaims(tx *gorm.DB, nodeID int, snap *runtime.TrafficSnapshot
|
||||
case scope.elsewhere:
|
||||
claims.refused[email] = "it is attached only to inbounds this node does not host"
|
||||
claims.usageOnly[email] = struct{}{}
|
||||
case !scope.here && (rec.SyncOrphanedAt == 0 || rec.SyncOrphanedBy != nodeID):
|
||||
// A mark from before sync_orphaned_by existed names no node, so any node may take it back.
|
||||
case !scope.here && (rec.SyncOrphanedAt == 0 || (rec.SyncOrphanedBy != 0 && rec.SyncOrphanedBy != nodeID)):
|
||||
claims.refused[email] = "it is detached from every inbound on the master"
|
||||
case subID != rec.SubID && subID != "" && subIDTaken(email, subID):
|
||||
claims.storedSubID[email] = rec.SubID
|
||||
|
||||
Reference in New Issue
Block a user