mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-04 18:17:16 +01:00
wdclient: gate the master lookup provider's cache writes on the map epoch
The provider wrote each answer straight into the vid map, so a lookup sent before a master reset and answered after it landed in the new generation, which a gateway's FilerClient now reads as the current master's view. The answer now goes through fillLocations, which drops it once a reset passed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6626597e93
commit
bc9e2ff20e
1 file changed
+2
-2
@@ -72,6 +72,7 @@ func (p *masterVolumeProvider) LookupVolumeIds(ctx context.Context, volumeIds []
|
||||
func() error {
|
||||
result = make(map[string][]Location)
|
||||
lookupErrors = nil
|
||||
epoch := p.masterClient.mapEpoch()
|
||||
|
||||
// Per-attempt timeout bounds both master resolution and the RPC
|
||||
// so a single attempt cannot consume the entire retry budget.
|
||||
@@ -124,10 +125,9 @@ func (p *masterVolumeProvider) LookupVolumeIds(ctx context.Context, volumeIds []
|
||||
ReadOnly: masterLoc.ReadOnly,
|
||||
ReadOnlyCanDelete: masterLoc.ReadOnlyCanDelete,
|
||||
}
|
||||
// Update cache with the location
|
||||
p.masterClient.addLocation(uint32(vid), loc)
|
||||
locations = append(locations, loc)
|
||||
}
|
||||
p.masterClient.fillLocations(uint32(vid), locations, epoch)
|
||||
|
||||
if len(locations) > 0 {
|
||||
result[vidOnly] = locations
|
||||
|
||||
Reference in new issue
Block a user