mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-04 18:17:16 +01:00
replication, master: read the epoch row after the sync; the HTTP evidence provider is test-only
LocalPrimaryEvidence synced after reading the table, so a row appended in between was paired with a newer end. Sync first, then read the table. The workload-plan HTTP provider has no production caller since the probe round; it moves to a test file so the round is the one way to evidence. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
121a4ec5ed
commit
85171f71fa
3 files changed
+19
-10
No files matched your search
@@ -85,3 +85,11 @@ func (s *services) AnswerProbe(ctx context.Context, a *control.ProbeAnswer) (*co
|
||||
s.host.probeHub.deliver(a)
|
||||
return &control.ProbeAck{}, nil
|
||||
}
|
||||
|
||||
func cloneRequiredLSNMap(in map[string]uint64) map[string]uint64 {
|
||||
out := make(map[string]uint64, len(in))
|
||||
for k, v := range in {
|
||||
out[k] = v
|
||||
}
|
||||
return out
|
||||
}
|
||||
+7
-9
@@ -1,11 +1,15 @@
|
||||
package master
|
||||
|
||||
// A test-only promotion evidence provider that reads the replicas' HTTP
|
||||
// status. Production evidence comes only from the probe round
|
||||
// (NewRoundPromotionEvidenceProvider); this stays for the tests that drive
|
||||
// the gate from a workload plan.
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/seaweedfs/seaweed-block/core/storage"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/url"
|
||||
@@ -13,6 +17,8 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/seaweedfs/seaweed-block/core/storage"
|
||||
|
||||
"github.com/seaweedfs/seaweed-block/core/authority"
|
||||
"github.com/seaweedfs/seaweed-block/core/frontend/durable"
|
||||
"github.com/seaweedfs/seaweed-block/core/host/volume"
|
||||
@@ -242,11 +248,3 @@ func isLocalhostOrLoopbackHost(host string) bool {
|
||||
ip := net.ParseIP(host)
|
||||
return ip != nil && ip.IsLoopback()
|
||||
}
|
||||
|
||||
func cloneRequiredLSNMap(in map[string]uint64) map[string]uint64 {
|
||||
out := make(map[string]uint64, len(in))
|
||||
for k, v := range in {
|
||||
out[k] = v
|
||||
}
|
||||
return out
|
||||
}
|
||||
@@ -256,8 +256,11 @@ func (v *ReplicationVolume) EpochTableStatus() EpochTableStatus {
|
||||
// LocalPrimaryEvidence is this volume's epoch table and durable end, as a
|
||||
// primary line's target checks them before adopting the role.
|
||||
func (v *ReplicationVolume) LocalPrimaryEvidence() (EpochTableStatus, uint64, error) {
|
||||
st := v.EpochTableStatus()
|
||||
// Sync first, then read the table: a row appended in between is then
|
||||
// read with an end that already covers it (never an old row with a
|
||||
// newer end).
|
||||
end, err := v.store.Sync()
|
||||
st := v.EpochTableStatus()
|
||||
return st, end, err
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user