Skip to content

Commit

Permalink
set primary with force
Browse files Browse the repository at this point in the history
* continued refactoring
* part eight, prev. commit: 199af07

Signed-off-by: Alex Aizman <[email protected]>
  • Loading branch information
alex-aizman committed Nov 8, 2024
1 parent 36690a9 commit 16280ab
Show file tree
Hide file tree
Showing 6 changed files with 326 additions and 260 deletions.
2 changes: 1 addition & 1 deletion ais/htrun.go
Original file line number Diff line number Diff line change
Expand Up @@ -2004,7 +2004,7 @@ func (h *htrun) regTo(url string, psi *meta.Snode, tout time.Duration, htext hte
skipConfig: true, // ditto
skipEtlMD: true, // ditto

fillRebMarker: !keepalive && htext != nil, // TODO -- FIXME
fillRebMarker: !keepalive && htext != nil,
skipPrimeTime: true,
}
)
Expand Down
2 changes: 1 addition & 1 deletion ais/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -2852,7 +2852,7 @@ func (p *proxy) httpdaepost(w http.ResponseWriter, r *http.Request) {
}
act := apiItems[0]
if act == apc.ActPrimaryForce {
p.prepForceJoin(w, r)
p.daeForceJoin(w, r)
return
}
if act != apc.AdminJoin {
Expand Down
46 changes: 0 additions & 46 deletions ais/prxclu.go
Original file line number Diff line number Diff line change
Expand Up @@ -2140,49 +2140,3 @@ func mustRebalance(ctx *smapModifier, cur *smapX) bool {
}
return false
}

/////////////
// cluMeta //
/////////////

// check essentials
func (cm *cluMeta) validate() error {
if cm.Smap == nil || !cm.Smap.isValid() {
return errors.New("invalid Smap")
}
if cm.BMD == nil || cm.BMD.version() == 0 || !cos.IsValidUUID(cm.BMD.UUID) {
return errors.New("invalid BMD")
}
if cm.Config == nil || cm.Config.version() == 0 || !cos.IsValidUUID(cm.Config.UUID) {
return errors.New("invalid Config")
}
return nil
}

func (cm *cluMeta) metasync(p *proxy, msg *aisMsg, wait bool) {
var (
detail string
revs = make([]revsPair, 0, 5)
)
if cm.Smap != nil && cm.Smap.isValid() {
detail = cm.Smap.StringEx()
revs = append(revs, revsPair{cm.Smap, msg})
}
if cm.BMD != nil && cm.BMD.version() > 0 && cos.IsValidUUID(cm.BMD.UUID) {
revs = append(revs, revsPair{cm.BMD, msg})
}
if cm.Config != nil && cm.Config.version() > 0 && cos.IsValidUUID(cm.Config.UUID) {
revs = append(revs, revsPair{cm.Config, msg})
}
if cm.RMD != nil {
revs = append(revs, revsPair{cm.RMD, msg})
}
if cm.EtlMD != nil {
revs = append(revs, revsPair{cm.EtlMD, msg})
}
nlog.InfoDepth(1, p.String(), "metasync-all", msg.Action, detail, len(revs))
wg := p.metasyncer.sync(revs...)
if wait {
wg.Wait()
}
}
Loading

0 comments on commit 16280ab

Please sign in to comment.