Skip to content

Commit

Permalink
DAOS-15651 control: fail fast on invalid rank for integrate
Browse files Browse the repository at this point in the history
check rank against membership before issuing rank update
for integrate.
Also fix a minor unit test bug related to getting syslog

Signed-off-by: Christopher Davis <[email protected]>
  • Loading branch information
cdavis28 committed Apr 17, 2024
1 parent c555ef0 commit f61a133
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/control/logging/syslog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func TestSyslogOutput(t *testing.T) {
t.Log("unable to locate journalctl -- not running this test")
return
}
cmd := exec.Command(journalctl, "--system")
cmd := exec.Command(journalctl, "--system", "--since", "1 minute ago")
if err := cmd.Run(); err != nil {
t.Log("current user does not have permissions to view system log")
return
Expand Down
17 changes: 17 additions & 0 deletions src/control/server/mgmt_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,23 @@ func (svc *mgmtSvc) PoolReintegrate(ctx context.Context, req *mgmtpb.PoolReinteg
if err != nil {
return nil, err
}

r := ranklist.Rank(req.Rank)

//var m *system.Membership

m, err := svc.membership.Get(r)
if err != nil {
return nil, err
}

if m.State&system.AvailableMemberFilter == 0 {
// invalid := make([]ranklist.Rank, 1)
invalid := []ranklist.Rank{r}
//invalid[0] = r
return nil, FaultPoolInvalidRanks(invalid)
}

req.Tierbytes = ps.Storage.PerRankTierStorage

dresp, err := svc.makeLockedPoolServiceCall(ctx, drpc.MethodPoolReintegrate, req)
Expand Down

0 comments on commit f61a133

Please sign in to comment.