Skip to content

DAOS-17322 ddb: DTX aggregation with ddb (Part 2) - #16746

Merged
gnailzenh merged 27 commits into
masterfrom
ckochhof/dev/master/daos-17322-part2
Oct 23, 2025
Merged

gnailzenh merged 27 commits into
masterfrom
ckochhof/dev/master/daos-17322-part2

Conversation

@knard38

@knard38 knard38 commented Aug 18, 2025 •

Copy link
Copy Markdown
Contributor

Description

Add the following new command to ddb:

  • dtx_aggr: Aggregate DTX entries

Steps for the author:

  • Commit message follows the guidelines.
  • Appropriate Features or Test-tag pragmas were used.
  • Appropriate Functional Test Stages were run.
  • At least two positive code reviews including at least one code owner from each category referenced in the PR.
  • Testing is complete. If necessary, forced-landing label added and a reason added in a comment.

After all prior steps are complete:

  • Gatekeeper requested (daos-gatekeeper added as a reviewer).

@github-actions

github-actions Bot commented Aug 18, 2025 •

Copy link
Copy Markdown

Ticket title is 'DTX aggregation with ddb'
Status is 'In Review'
Labels: '2.8pp'
https://daosio.atlassian.net/browse/DAOS-17322

@knard38 knard38 self-assigned this Aug 19, 2025
@knard38
knard38 force-pushed the ckochhof/dev/master/daos-17322-part2 branch from 52ac348 to 65436bd Compare September 15, 2025 14:33
@daosbuild3

Copy link
Copy Markdown
Collaborator

@daosbuild3

Copy link
Copy Markdown
Collaborator

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Unit Test with memcheck on EL 8.8 completed with status UNSTABLE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos//view/change-requests/job/PR-16746/2/testReport/

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Unit Test bdev with memcheck on EL 8.8 completed with status UNSTABLE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos//view/change-requests/job/PR-16746/2/testReport/

@knard38
knard38 force-pushed the ckochhof/dev/master/daos-17322-part2 branch from 65436bd to fbff07e Compare September 15, 2025 20:46
@daosbuild3

Copy link
Copy Markdown
Collaborator

@daosbuild3

Copy link
Copy Markdown
Collaborator

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Unit Test with memcheck on EL 8.8 completed with status UNSTABLE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos//view/change-requests/job/PR-16746/3/testReport/

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Unit Test bdev with memcheck on EL 8.8 completed with status UNSTABLE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos//view/change-requests/job/PR-16746/3/testReport/

@knard38
knard38 force-pushed the ckochhof/dev/master/daos-17322-part2 branch 2 times, most recently from a70b32a to 79e20a2 Compare September 22, 2025 08:36
gnailzenh pushed a commit that referenced this pull request Sep 26, 2025
* DAOS-17322 ddb: DTX aggregation with ddb


This preliminary PR introduce the following modifications:

- Cleanup of the SCons file src/utils/ddb/tests/SConscript
- Fix miscellaneous issues detected by clangd linter.
- Add a new DDB sub command dtx_stat allowing to print statistics on DTX entries.
- This PR will be followed by the PR #16746 introducing a new DDB sub command dtx_aggr
   allowing to aggregate DTX entries with DDB.

Signed-off-by: Cedric Koch-Hofer <cedric.koch-hofer@hpe.com>
Base automatically changed from ckochhof/dev/master/daos-17322-part1 to master September 26, 2025 02:29
@knard38
knard38 force-pushed the ckochhof/dev/master/daos-17322-part2 branch from 79e20a2 to c6ff645 Compare September 26, 2025 06:15
@knard38
knard38 marked this pull request as ready for review September 26, 2025 06:16
@knard38
knard38 requested review from a team September 26, 2025 06:16
@knard38
knard38 requested review from a team as code owners September 26, 2025 06:16
@knard38
knard38 marked this pull request as draft September 26, 2025 06:17
@knard38
knard38 force-pushed the ckochhof/dev/master/daos-17322-part2 branch from c6ff645 to d99caab Compare September 26, 2025 06:24
@knard38
knard38 marked this pull request as ready for review September 26, 2025 06:25
Fix clang format issues.

Features: aggregation
Signed-off-by: Cedric Koch-Hofer <cedric.koch-hofer@hpe.com>
@knard38
knard38 requested a review from Nasf-Fan October 15, 2025 19:39
@daosbuild3

Copy link
Copy Markdown
Collaborator

@daosbuild3

Copy link
Copy Markdown
Collaborator

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Unit Test with memcheck on EL 8.8 completed with status UNSTABLE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos//view/change-requests/job/PR-16746/23/testReport/

Fix unit test.

Features: aggregation
Signed-off-by: Cedric Koch-Hofer <cedric.koch-hofer@hpe.com>
Fix function argument name.

Features: aggregation
Signed-off-by: Cedric Koch-Hofer <cedric.koch-hofer@hpe.com>
Fix function argument comment.

Features: aggregation
Signed-off-by: Cedric Koch-Hofer <cedric.koch-hofer@hpe.com>

@Nasf-Fan Nasf-Fan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @knard38 for the update. Looks more clean than former ones. Generally, it is fine, some trivial suggestions.

Comment thread src/include/daos_srv/vos.h Outdated
* \return Zero on success, negative value if error.
* \return Negative value if error, zero if all DTX entries with an epoch lower
* or equal to ep_max have been aggregated, one if all the targeted DTX
* entries may not have been aggregated.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest:

Zero if maybe more DTX entries can be aggregated.
Positive value if all qualified DTX entries have been removed.
Negative value for error.

Then only dtx aggregation via ddb needs to check the postive return value, all the other existing vos_dtx_aggregate() callers do not change return value checking logic.

@knard38 knard38 Oct 17, 2025 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest:

Zero if maybe more DTX entries can be aggregated.
Positive value if all qualified DTX entries have been removed.
Negative value for error.

Then only dtx aggregation via ddb needs to check the postive return value, all the other existing vos_dtx_aggregate() callers do not change return value checking logic.

  • Fix comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest:

Zero if maybe more DTX entries can be aggregated.
Positive value if all qualified DTX entries have been removed.
Negative value for error.

Then only dtx aggregation via ddb needs to check the postive return value, all the other existing vos_dtx_aggregate() callers do not change return value checking logic.

  • Fix comment

Fixed with commit c6ee641

Comment thread src/utils/ddb/ddb_parse.h
/* Parse a string representing a date into an epoch */
int
ddb_date2epoch(const char *date, uint64_t *epoch);
ddb_date2cmt_time(const char *date, uint64_t *cmt_time);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please refresh the comment to match the changes.

@knard38 knard38 Oct 17, 2025 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please refresh the comment to match the changes.

  • Fix comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please refresh the comment to match the changes.

  • Fix comment

Fixed with commit c6ee641

Comment thread src/utils/ddb/ddb_commands.c Outdated
ddb_printf(ctx, "\t- %s%s", prefix, align);

rc = 0;
for (i = 0; i < 3; i++) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be more safe to pass the length of epoch_stats as parameter instead of hard coded as "3".

@knard38 knard38 Oct 17, 2025 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be more safe to pass the length of epoch_stats as parameter instead of hard coded as "3".

  • Use constant instead of hard coded value

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be more safe to pass the length of epoch_stats as parameter instead of hard coded as "3".

  • Use constant instead of hard coded value

Fixed with commit c6ee641

Comment thread src/utils/ddb/ddb_commands.c Outdated
ddb_printf(ctx, "\t- %s%s", prefix, align);

rc = 0;
for (i = 0; i < 3; i++) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar as above.

@knard38 knard38 Oct 17, 2025 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar as above.

  • Use constant instead of hard coded value

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar as above.

  • Use constant instead of hard coded value

Fixed with commit c6ee641

Comment thread src/utils/ddb/ddb_commands.c Outdated
goto done;
args->cmt_cnt += cnt;

args->cmt_cnt += args_tmp.cmt_cnt;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For details case, move it after calculating the mean value for time/epoch?

@knard38 knard38 Oct 17, 2025 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arghhhh, too quick copy/paste from my canceled PR https://github.com/daos-stack/daos/pull/16954/files#diff-c5fc3d2ed692ce1cc27be1a6d725d458e14d22d35374f71e40dd8921b6365698R1442
Thanks a lot to have found this issue, which also some hole into the unit tests.

  • Fix invalid mean calculation.
  • Improve unit test of the ddb_run_dtx_stat() function.

@knard38 knard38 Oct 17, 2025 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding new unit tests to have full control over the behaviour of ddb_run_dtx_stat(), makes the testing code over complicated for a non critical feature. Thus, I will not add new unit tests accurately checking the mean computation and other DTX commit statistics.
Is it OK for you @Nasf-Fan ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arghhhh, too quick copy/paste from my canceled PR https://github.com/daos-stack/daos/pull/16954/files#diff-c5fc3d2ed692ce1cc27be1a6d725d458e14d22d35374f71e40dd8921b6365698R1442 Thanks a lot to have found this issue, which also some hole into the unit tests.

  • Fix invalid mean calculation.
  • Improve unit test of the ddb_run_dtx_stat() function.

Fixed with commit c6ee641

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding new unit tests to have full control over the behaviour of ddb_run_dtx_stat(), makes the testing code over complicated for a non critical feature. Thus, I will not add new unit tests accurately checking the mean computation and other DTX commit statistics. Is it OK for you @Nasf-Fan ?

That's fine for me.

Comment thread src/utils/ddb/ddb_commands.c Outdated
ddb_error(ctx, "Failed to close container ");
itp_print_full(ctx, itp);
ddb_errorf(ctx, ": " DF_RC "\n", DP_RC(rc));
return rc;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This return is unnecessary since there is another following return.

@knard38 knard38 Oct 17, 2025 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This return is unnecessary since there is another following return.

  • Remove useless return

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This return is unnecessary since there is another following return.

  • Remove useless return

Fixed with commit c6ee641

Fix reviewers comments:
- Fix comments
- Use constant instead of hard coded value
- Fix invalid mean calculation
- Remove useless return

Features: aggregation
Signed-off-by: Cedric Koch-Hofer <cedric.koch-hofer@hpe.com>
Fix invalid last epoch aggregation computation.

Features: aggregation
Signed-off-by: Cedric Koch-Hofer <cedric.koch-hofer@hpe.com>
Fix minor coding sytle.

Features: aggregation
Signed-off-by: Cedri,c Koch-Hofer <cedric.koch-hofer@hpe.com>
@knard38
knard38 requested a review from Nasf-Fan October 17, 2025 17:35
@knard38

knard38 commented Oct 17, 2025

Copy link
Copy Markdown
Contributor Author

@kjacque , please could you have a look at the go code part of the code.
Thanks in advance for your attention.

Fix clang format issues.

Features: aggregation
Signed-off-by: Cedric Koch-Hofer <cedric.koch-hofer@hpe.com>
@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Functional Hardware Medium MD on SSD completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-16746/30/execution/node/1291/log

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Functional Hardware Medium Verbs Provider MD on SSD completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-16746/30/execution/node/1336/log

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Functional Hardware Large MD on SSD completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-16746/30/execution/node/1475/log

@johannlombardi

Copy link
Copy Markdown
Contributor

@knard38 could you please check whether any of the failures are related to your changes?

@knard38

knard38 commented Oct 21, 2025

Copy link
Copy Markdown
Contributor Author

@knard38 could you please check whether any of the failures are related to your changes?

The CI failures are known CI issues:

I have restarted a run of the functional test https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos/job/PR-16746/31/pipeline-overview/

@knard38 knard38 added the CR Catastrophic Recovery Feature label Oct 21, 2025
@knard38

knard38 commented Oct 21, 2025 •

Copy link
Copy Markdown
Contributor Author

@knard38 could you please check whether any of the failures are related to your changes?

The CI failures are known CI issues:

I have restarted a run of the functional test https://jenkins-3.daos.hpc.amslabs.hpecorp.net/job/daos-stack/job/daos/job/PR-16746/31/pipeline-overview/

@johannlombardi , all the functional test have been passed with the new run confirming the hypothesis that the CI failures of the build 30 are not related to this PR.

The DCO failure is a mistake from my side on an old commit:I prefer to not amend this commit to not touch the commit history.

a.String("path", "Optional, VOS tree path of a container to aggregate.", grumble.Default(""))
},
Flags: func(f *grumble.Flags) {
f.Uint64("t", "cmt_time", math.MaxUint64, "Max aggregfation committed time in seconds")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor, typo

Suggested change
f.Uint64("t", "cmt_time", math.MaxUint64, "Max aggregfation committed time in seconds")
f.Uint64("t", "cmt_time", math.MaxUint64, "Max aggregation committed time in seconds")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor, typo

I am going to fix it in a follow-up PR

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor, typo

Fixed with PR #17022

func (cmdStr ddbCmdStr) Complete(match string) (comps []flags.Completion) {
// hack to get at command names
ctx, cleanup, err := InitDdb()
ctx, cleanup, err := InitDdb(nil)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it OK to pass nil here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, the associated complete function are indeed never using the log attributes.
I agree, that it is not very nice but it is the only way that I found to pass the log object for the standard call of InitDB().

Comment thread src/vos/vos_dtx.c
D_ERROR("Failed to update tail for DTX aggregation "
UMOFF_PF": "DF_RC"\n",
rc = umem_tx_add_ptr(umm, &dbd->dbd_committed_data[0],
sizeof(dbd->dbd_committed_data[0]) * dbd->dbd_count);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a big deal, but it's better to change it to "sizeof(...) * (dbd->dbd_count - dtx_aggr_count)" right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As illustrated by the following figure, the value is exact as we are translating some memory on all this memory area.
image

vos_oi_exist(daos_handle_t coh, daos_unit_oid_t oid);

/* Timing statistic of DTX entries */
#define DTX_TIME_STAT_COUNT 3

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: I think the clearer style would be like:

enum {
           DTX_TIME_STAT_MIN,
           DTX_TIME_STAT_MAX,
           DTX_TIME_STAT_MEAN,
           DTX_TIME_STAT_COUNT
};

so you can use them as alias of the array index instead of using 0, 1, 2

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am going to fix it in a following-up PR

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed with PR #17022

@gnailzenh
gnailzenh merged commit e68a72f into master Oct 23, 2025
40 of 41 checks passed
@gnailzenh
gnailzenh deleted the ckochhof/dev/master/daos-17322-part2 branch October 23, 2025 04:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CR Catastrophic Recovery Feature

Development

Successfully merging this pull request may close these issues.

7 participants