@@ -195,10 +195,6 @@ func (ms *mapSession) HandleNonKeepAliveMapResponse(ctx context.Context, resp *t
195
195
196
196
ms .updateStateFromResponse (resp )
197
197
198
- // Occasionally clean up old userprofile if it grows too much
199
- // from e.g. ephemeral tagged nodes.
200
- ms .cleanLastUserProfile ()
201
-
202
198
if ms .tryHandleIncrementally (resp ) {
203
199
ms .occasionallyPrintSummary (ms .lastNetmapSummary )
204
200
return nil
@@ -296,6 +292,7 @@ func (ms *mapSession) updateStateFromResponse(resp *tailcfg.MapResponse) {
296
292
for _ , up := range resp .UserProfiles {
297
293
ms .lastUserProfile [up .ID ] = up
298
294
}
295
+ // TODO(bradfitz): clean up old user profiles? maybe not worth it.
299
296
300
297
if dm := resp .DERPMap ; dm != nil {
301
298
ms .vlogf ("netmap: new map contains DERP map" )
@@ -544,32 +541,6 @@ func (ms *mapSession) addUserProfile(nm *netmap.NetworkMap, userID tailcfg.UserI
544
541
}
545
542
}
546
543
547
- // cleanLastUserProfile deletes any entries from lastUserProfile
548
- // that are not referenced by any peer or the self node.
549
- //
550
- // This is expensive enough that we don't do this on every message
551
- // from the server, but only when it's grown enough to matter.
552
- func (ms * mapSession ) cleanLastUserProfile () {
553
- if len (ms .lastUserProfile ) < len (ms .peers )* 2 {
554
- // Hasn't grown enough to be worth cleaning.
555
- return
556
- }
557
-
558
- keep := set.Set [tailcfg.UserID ]{}
559
- if node := ms .lastNode ; node .Valid () {
560
- keep .Add (node .User ())
561
- }
562
- for _ , n := range ms .peers {
563
- keep .Add (n .User ())
564
- keep .Add (n .Sharer ())
565
- }
566
- for userID := range ms .lastUserProfile {
567
- if ! keep .Contains (userID ) {
568
- delete (ms .lastUserProfile , userID )
569
- }
570
- }
571
- }
572
-
573
544
var debugPatchifyPeer = envknob .RegisterBool ("TS_DEBUG_PATCHIFY_PEER" )
574
545
575
546
// patchifyPeersChanged mutates resp to promote PeersChanged entries to PeersChangedPatch
0 commit comments