Skip to content

Commit

Permalink
Merge branch 'pahender/DAOS-16220' into pahender/DAOS-16220_user_test
Browse files Browse the repository at this point in the history
Skip-unit-tests: true
Skip-fault-injection-test: true
Features: deployment performance

Required-githooks: true

Signed-off-by: Phil Henderson <phillip.henderson@intel.com>
  • Loading branch information
phender committed Oct 17, 2024
2 parents 1568f0e + 12d0c0e commit 9d0be47
Show file tree
Hide file tree
Showing 46 changed files with 796 additions and 399 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: '3'
- uses: isort/isort-action@master
- uses: isort/isort-action@f14e57e1d457956c45a19c05a89cccdf087846e5 # v1.1.0
with:
requirementsFiles: "requirements.txt"
- name: Run on SConstruct file.
Expand Down
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
daos (2.7.100-8) unstable; urgency=medium
[ Cedric Koch-Hofer]
* Update BR: argobots to 1.2

-- Cedric Koch-Hofer <cedric.koch-hofer@intel.com> Mon, 07 Oct 2024 11:06:00 -0700

daos (2.7.100-7) unstable; urgency=medium
[ Tomasz Gromadzki ]
* Add support of the PMDK package 2.1.0 with NDCTL enabled.
Expand Down
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Build-Depends: debhelper (>= 10),
pkg-config,
python3-dev,
python3-distro,
libabt-dev,
libabt-dev (>= 1.2),
libucx-dev,
libpmemobj-dev (>= 2.1.0),
libfuse3-dev,
Expand Down
1 change: 1 addition & 0 deletions src/container/srv_target.c
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,7 @@ cont_child_alloc_ref(void *co_uuid, unsigned int ksize, void *po_uuid,
cont->sc_dtx_committable_coll_count = 0;
D_INIT_LIST_HEAD(&cont->sc_dtx_cos_list);
D_INIT_LIST_HEAD(&cont->sc_dtx_coll_list);
D_INIT_LIST_HEAD(&cont->sc_dtx_batched_list);

*link = &cont->sc_list;
return 0;
Expand Down
20 changes: 12 additions & 8 deletions src/control/lib/telemetry/counter.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// (C) Copyright 2021-2022 Intel Corporation.
// (C) Copyright 2021-2024 Intel Corporation.
//
// SPDX-License-Identifier: BSD-2-Clause-Patent
//
Expand Down Expand Up @@ -37,18 +37,22 @@ func (c *Counter) FloatValue() float64 {
}

func (c *Counter) Value() uint64 {
ctrVal := BadUintVal
if c.handle == nil || c.node == nil {
return BadUintVal
return ctrVal
}

var val C.uint64_t

res := C.d_tm_get_counter(c.handle.ctx, &val, c.node)
if res == C.DER_SUCCESS {
return uint64(val)
fetch := func() C.int {
var val C.uint64_t
res := C.d_tm_get_counter(c.handle.ctx, &val, c.node)
if res == C.DER_SUCCESS {
ctrVal = uint64(val)
}
return res
}
c.fetchValWithRetry(fetch)

return BadUintVal
return ctrVal
}

func newCounter(hdl *handle, path string, name *string, node *C.struct_d_tm_node_t) *Counter {
Expand Down
20 changes: 12 additions & 8 deletions src/control/lib/telemetry/duration.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// (C) Copyright 2021-2022 Intel Corporation.
// (C) Copyright 2021-2024 Intel Corporation.
//
// SPDX-License-Identifier: BSD-2-Clause-Patent
//
Expand Down Expand Up @@ -34,18 +34,22 @@ func (d *Duration) Type() MetricType {
}

func (d *Duration) Value() time.Duration {
durValue := BadDuration
if d.handle == nil || d.node == nil {
return BadDuration
return durValue
}

var tms C.struct_timespec

res := C.d_tm_get_duration(d.handle.ctx, &tms, &d.stats, d.node)
if res == C.DER_SUCCESS {
return time.Duration(tms.tv_sec)*time.Second + time.Duration(tms.tv_nsec)*time.Nanosecond
fetch := func() C.int {
var tms C.struct_timespec
res := C.d_tm_get_duration(d.handle.ctx, &tms, &d.stats, d.node)
if res == C.DER_SUCCESS {
durValue = time.Duration(tms.tv_sec)*time.Second + time.Duration(tms.tv_nsec)*time.Nanosecond
}
return res
}
d.fetchValWithRetry(fetch)

return BadDuration
return durValue
}

func (d *Duration) FloatValue() float64 {
Expand Down
38 changes: 23 additions & 15 deletions src/control/lib/telemetry/gauge.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// (C) Copyright 2021-2022 Intel Corporation.
// (C) Copyright 2021-2024 Intel Corporation.
//
// SPDX-License-Identifier: BSD-2-Clause-Patent
//
Expand Down Expand Up @@ -41,18 +41,22 @@ func (g *Gauge) FloatValue() float64 {

// Value returns the value as an unsigned integer.
func (g *Gauge) Value() uint64 {
gaugeVal := BadUintVal
if g.handle == nil || g.node == nil {
return BadUintVal
return gaugeVal
}

var val C.uint64_t

res := C.d_tm_get_gauge(g.handle.ctx, &val, nil, g.node)
if res == C.DER_SUCCESS {
return uint64(val)
fetch := func() C.int {
var val C.uint64_t
res := C.d_tm_get_gauge(g.handle.ctx, &val, nil, g.node)
if res == C.DER_SUCCESS {
gaugeVal = uint64(val)
}
return res
}
g.fetchValWithRetry(fetch)

return BadUintVal
return gaugeVal
}

func newGauge(hdl *handle, path string, name *string, node *C.struct_d_tm_node_t) *Gauge {
Expand Down Expand Up @@ -103,18 +107,22 @@ func (g *StatsGauge) FloatValue() float64 {

// Value returns the gauge value as an unsigned integer.
func (g *StatsGauge) Value() uint64 {
gaugeVal := BadUintVal
if g.handle == nil || g.node == nil {
return BadUintVal
return gaugeVal
}

var val C.uint64_t

res := C.d_tm_get_gauge(g.handle.ctx, &val, &g.stats, g.node)
if res == C.DER_SUCCESS {
return uint64(val)
fetch := func() C.int {
var val C.uint64_t
res := C.d_tm_get_gauge(g.handle.ctx, &val, &g.stats, g.node)
if res == C.DER_SUCCESS {
gaugeVal = uint64(val)
}
return res
}
g.fetchValWithRetry(fetch)

return BadUintVal
return gaugeVal
}

func newStatsGauge(hdl *handle, path string, name *string, node *C.struct_d_tm_node_t) *StatsGauge {
Expand Down
20 changes: 12 additions & 8 deletions src/control/lib/telemetry/snapshot.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// (C) Copyright 2021-2022 Intel Corporation.
// (C) Copyright 2021-2024 Intel Corporation.
//
// SPDX-License-Identifier: BSD-2-Clause-Patent
//
Expand Down Expand Up @@ -34,18 +34,22 @@ func (s *Snapshot) Type() MetricType {
}

func (s *Snapshot) Value() time.Time {
timeVal := time.Time{} // zero val
if s.handle == nil || s.node == nil {
return time.Time{}
return timeVal
}

var tms C.struct_timespec

res := C.d_tm_get_timer_snapshot(s.handle.ctx, &tms, s.node)
if res == C.DER_SUCCESS {
return time.Unix(int64(tms.tv_sec), int64(tms.tv_nsec))
fetch := func() C.int {
var tms C.struct_timespec
res := C.d_tm_get_timer_snapshot(s.handle.ctx, &tms, s.node)
if res == C.DER_SUCCESS {
timeVal = time.Unix(int64(tms.tv_sec), int64(tms.tv_nsec))
}
return res
}
s.fetchValWithRetry(fetch)

return time.Time{}
return timeVal
}

func (s *Snapshot) FloatValue() float64 {
Expand Down
12 changes: 12 additions & 0 deletions src/control/lib/telemetry/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ const (
BadDuration = time.Duration(BadIntVal)

PathSep = filepath.Separator

maxFetchRetries = 1
)

type (
Expand Down Expand Up @@ -304,6 +306,16 @@ func (mb *metricBase) String() string {
return strings.TrimSpace(string(buf[:bytes.Index(buf, []byte{0})]))
}

func (mb *metricBase) fetchValWithRetry(fetchFn func() C.int) C.int {
var rc C.int
for i := 0; i < maxFetchRetries; i++ {
if rc = fetchFn(); rc == C.DER_SUCCESS {
return rc
}
}
return rc
}

func (sm *statsMetric) Min() uint64 {
return uint64(sm.stats.dtm_min)
}
Expand Down
22 changes: 14 additions & 8 deletions src/control/lib/telemetry/timestamp.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// (C) Copyright 2021-2022 Intel Corporation.
// (C) Copyright 2021-2024 Intel Corporation.
//
// SPDX-License-Identifier: BSD-2-Clause-Patent
//
Expand Down Expand Up @@ -34,16 +34,22 @@ func (t *Timestamp) Type() MetricType {
}

func (t *Timestamp) Value() time.Time {
zero := time.Time{}
timeVal := time.Time{} // zero val
if t.handle == nil || t.node == nil {
return zero
return timeVal
}
var clk C.time_t
res := C.d_tm_get_timestamp(t.handle.ctx, &clk, t.node)
if res == C.DER_SUCCESS {
return time.Unix(int64(clk), 0)

fetch := func() C.int {
var clk C.time_t
res := C.d_tm_get_timestamp(t.handle.ctx, &clk, t.node)
if res == C.DER_SUCCESS {
timeVal = time.Unix(int64(clk), 0)
}
return res
}
return zero
t.fetchValWithRetry(fetch)

return timeVal
}

// FloatValue converts the timestamp to time in seconds since the UNIX epoch.
Expand Down
2 changes: 2 additions & 0 deletions src/control/server/mgmt_system.go
Original file line number Diff line number Diff line change
Expand Up @@ -1002,6 +1002,8 @@ func (svc *mgmtSvc) SystemExclude(ctx context.Context, req *mgmtpb.SystemExclude
})
}

svc.reqGroupUpdate(ctx, false)

return resp, nil
}

Expand Down
21 changes: 21 additions & 0 deletions src/control/server/mgmt_system_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1765,6 +1765,7 @@ func TestServer_MgmtSvc_SystemExclude(t *testing.T) {
mockMember(t, 3, 2, "joined"),
},
},

"unexclude hosts": {
req: &mgmtpb.SystemExcludeReq{Hosts: test.MockHostAddr(1).String(), Clear: true},
members: system.Members{
Expand Down Expand Up @@ -1795,12 +1796,32 @@ func TestServer_MgmtSvc_SystemExclude(t *testing.T) {
if tc.req != nil && tc.req.Sys == "" {
tc.req.Sys = build.DefaultSystemName
}

startMapVer, err := svc.sysdb.CurMapVersion()
if err != nil {
t.Fatalf("startMapVer CurMapVersion() failed\n")
return
}
gotResp, gotAPIErr := svc.SystemExclude(ctx, tc.req)
test.CmpErr(t, tc.expAPIErr, gotAPIErr)
if tc.expAPIErr != nil {
return
}

// Check for any system map version increase by the (asynchronous) update.
// Test will time out if it never happens, thus choice of an infinite loop here.
for {
curMapVer, err := svc.sysdb.CurMapVersion()
if err != nil {
t.Fatalf("CurMapVersion() failed\n")
return
}

if curMapVer > startMapVer {
break
}
}

checkRankResults(t, tc.expResults, gotResp.Results)
checkMembers(t, tc.expMembers, svc.membership)
})
Expand Down
Loading

0 comments on commit 9d0be47

Please sign in to comment.