Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DAOS-16661 common: Integrate PMDK logging system w/ VOS logging system. #14923

Open
wants to merge 50 commits into
base: master
Choose a base branch
from

Conversation

grom72
Copy link
Contributor

@grom72 grom72 commented Aug 13, 2024

pmemobj error and warning messages are written by default to stderr and syslog().
PMDK enables redirecting logging messages to user-specific functions.

All error and warning messages are reported using the DAOS logging function, to ensure a coherent events view for VOS and related pmemobj functions.

Requires:

Before requesting gatekeeper:

  • Two review approvals and any prior change requests have been resolved.
  • Testing is complete and all tests passed or there is a reason documented in the PR why it should be force landed and forced-landing tag is set.
  • Features: (or Test-tag*) commit pragma was used or there is a reason documented that there are no appropriate tags for this PR.
  • Commit messages follows the guidelines outlined here.
  • Any tests skipped by the ticket being addressed have been run and passed in the PR.

Gatekeeper:

  • You are the appropriate gatekeeper to be landing the patch.
  • The PR has 2 reviews by people familiar with the code, including appropriate owners.
  • Githooks were used. If not, request that user install them and check copyright dates.
  • Checkpatch issues are resolved. Pay particular attention to ones that will show up on future PRs.
  • All builds have passed. Check non-required builds for any new compiler warnings.
  • Sufficient testing is done. Check feature pragmas and test tags and that tests skipped for the ticket are run and now pass with the changes.
  • If applicable, the PR has addressed any potential version compatibility issues.
  • Check the target branch. If it is master branch, should the PR go to a feature branch? If it is a release branch, does it have merge approval in the JIRA ticket.
  • Extra checks if forced landing is requested
    • Review comments are sufficiently resolved, particularly by prior reviewers that requested changes.
    • No new NLT or valgrind warnings. Check the classic view.
    • Quick-build or Quick-functional is not used.
  • Fix the commit message upon landing. Check the standard here. Edit it to create a single commit. If necessary, ask submitter for a new summary.

Copy link

github-actions bot commented Aug 13, 2024

Ticket title is 'Integrate PMDK logging system w/ VOS logging system.'
Status is 'In Review'
Labels: 'scrubbed_2.8,test_2.8'
https://daosio.atlassian.net/browse/DAOS-16661

@daosbuild1
Copy link
Collaborator

Test stage NLT on EL 8.8 completed with status UNSTABLE. https://build.hpdd.intel.com/job/daos-stack/job/daos//view/change-requests/job/PR-14923/3/testReport/

@grom72 grom72 force-pushed the grom72/pmdk-w-logging branch 3 times, most recently from 75504b7 to ad62bd1 Compare September 3, 2024 07:38
To enable new message in log in NLT.
Allow-unstable-test: true

Priority: 2

Required-githooks: true

Co-authored-by: Jan Michalski <jan.michalski@intel.com>
Co-authored-by: Tomasz Gromadzki <tomasz.gromadzki@intel.com>

Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@intel.com>
@grom72 grom72 force-pushed the grom72/pmdk-w-logging branch from ad62bd1 to 149320c Compare September 3, 2024 10:59
@grom72 grom72 marked this pull request as ready for review September 3, 2024 11:01
@grom72 grom72 requested review from a team as code owners September 3, 2024 11:01
To enable new message in log in NLT.
Allow-unstable-test: true

Priority: 2

Required-githooks: true

Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@intel.com>
@grom72 grom72 requested a review from brianjmurrell September 3, 2024 20:56
Priority: 2

Allow-unstable-test: true
Skip-func-hw-test: false

Required-githooks: true

Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@intel.com>
@grom72 grom72 added the release-2.6.1 Targeted for release 2.6.1 label Sep 4, 2024
Skip-nlt: true
Priority: 2

Allow-unstable-test: true
Skip-func-hw-test: false

Required-githooks: true

Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@intel.com>
Copy link
Contributor

@brianjmurrell brianjmurrell left a comment

Choose a reason for hiding this comment

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

@grom72 Packaging changes LGTM. Please re-request review from me once you have gotten your two +1s for the core code changes and I will +1 to remove my -1 review. I just don't want my +1 to be misunderstood to be for the core code changes also.

@daosbuild1
Copy link
Collaborator

Test stage Functional Hardware Medium UCX Provider completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-14923/11/execution/node/1683/log

jolivier23
jolivier23 previously approved these changes Sep 5, 2024
@grom72 grom72 added release-2.6.2 Targeted for release 2.6.2 and removed release-2.6.1 Targeted for release 2.6.1 labels Sep 6, 2024
@grom72 grom72 requested a review from NiuYawei September 16, 2024 14:12
NiuYawei
NiuYawei previously approved these changes Sep 18, 2024
@daosbuild1
Copy link
Collaborator

Test stage Functional Hardware Medium UCX Provider completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-14923/12/execution/node/635/log

Skip-nlt: true
Priority: 2
Allow-unstable-test: true

Required-githooks: true

Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@intel.com>
Skip-list: test_ior_intercept_libpil4dfs:DAOS-16260
Allow-unstable-test: true

Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@hpe.com>
grom72 added a commit to daos-stack/pipeline-lib that referenced this pull request Mar 1, 2025
Static analysis of NLT results does not work properly when
a warning source code is out of scope of the project.
An error is reported in such case and  the whole stage status
is changed to FAILURE.
```
[NLT results] [-ERROR-] Can't create fingerprints for some files:
[NLT results] [-ERROR-] - 'pmdk/.../src/common/set.c' file not found
...
[NLT results] Failing build because analysis result contains errors
```

To prevent this problem, all PMDK-related messages are filtered out.

NLT results Warnings section will include warnings but will not
provide any detail information about location of this warning
in the source code.

Based on existing format of nlt-errors.json file the most easy way
to filtered all PMDK messages is to use the predefined "pmdk/" preffix
in the fileName:
```
...
{
        "fileName": "pmdk/src/../src/common/set.c",
        "type": "warning in strict mode",
        "lineStart": 2796,
        "description": "warning in strict mode",
        "message": "util_replica_check() Possible silent data corruption. The unsafe shutdown detection (SDS) is not supported in the pool: /mnt/daos_0/e5737f5f-fa54-45d6-b081-9b2769921610/vos-1\nwarning in strict mode",
        "severity": "NORMAL"
},
...
```
vos logging system should ensure that the file name of each PMDK
related message starts with "pmdk/" prefix.
The implementation of the solution is provided in
daos-stack/daos#14923 PR

Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@hpe.com>
Skip-list: test_ior_intercept_libpil4dfs:DAOS-16260
Allow-unstable-test: true

Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@hpe.com>
@grom72
Copy link
Contributor Author

grom72 commented Mar 5, 2025

All PMDK warnings has been muted in NLT and Fault Injection tests as they can not be processed properly.

There is one new PMDK warnings related to non-pmem baked libpmemobj pools.
They were reported to syslog, but now all PMDK errors/warnings are reported in the same place where vos put it's messages to have one coherent log of all pmem related issues.

@grom72 grom72 requested review from mchaarawi and jolivier23 March 5, 2025 19:20
daltonbohning pushed a commit to daos-stack/pipeline-lib that referenced this pull request Mar 5, 2025
NLT results analysis reports an error when it can not get source code of the reported warning.
PMDK reports warnings/errors via VOS logging system but the source code is not available.

Static analysis of NLT results does not work properly when
a warning source code is out of scope of the project.
An error is reported in such case and  the whole stage status
is changed to FAILURE.
```
[NLT results] [-ERROR-] Can't create fingerprints for some files:
[NLT results] [-ERROR-] - 'pmdk/.../src/common/set.c' file not found
...
[NLT results] Failing build because analysis result contains errors
```

To prevent this problem, all PMDK-related messages are filtered out.

NLT results Warnings section will include warnings but will not
provide any detail information about location of this warning
in the source code.

Based on existing format of nlt-errors.json file the most easy way
to filtered all PMDK messages is to use the predefined "pmdk/" preffix
in the fileName:
```
...
{
        "fileName": "pmdk/src/../src/common/set.c",
        "type": "warning in strict mode",
        "lineStart": 2796,
        "description": "warning in strict mode",
        "message": "util_replica_check() Possible silent data corruption. The unsafe shutdown detection (SDS) is not supported in the pool: /mnt/daos_0/e5737f5f-fa54-45d6-b081-9b2769921610/vos-1\nwarning in strict mode",
        "severity": "NORMAL"
},
...
```
The VOS logging system should ensure that the filename of each PMDK-related message starts with a "pmdk/" prefix.
The implementation of the solution is provided in daos-stack/daos#14923 PR

Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@hpe.com>
daos-stack/pipeline-lib#457 landed on
master.

This change only may affect NLT and Fault Injection tests
No need to execute HW and VM Functional Tests

Skip-unit-test: true
Skip-unit-test-memcheck: true
Skip-bullseye: true

Skip-fault-injection-test: false
Skip-func-test-vm-all: true
Skip-func-test-hw: true

Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@hpe.com>
@daosbuild1
Copy link
Collaborator

daosbuild1 commented Mar 6, 2025

Test stage NLT on EL 8.8 completed with status UNSTABLE. https://build.hpdd.intel.com/job/daos-stack/job/daos//view/change-requests/job/PR-14923/61/testReport/

Reported memchecke issue:

<![CDATA[
{
<insert_a_suppression_name_here>
   Memcheck:Addr4
   fun:__tsan_go_atomic32_fetch_add
   fun:racecall
}
]]>

has already been fixed on master #15967

__tsan_go_atomic32_fetch_add

No other issues in NLT and Fault Injection Tests

@grom72
Copy link
Contributor Author

grom72 commented Mar 9, 2025

@mchaarawi @jolivier23 @NiuYawei do we need one more complete execution of all tests or the actual validation status is good enough?

NiuYawei
NiuYawei previously approved these changes Mar 10, 2025
@mchaarawi
Copy link
Contributor

mchaarawi commented Mar 10, 2025

@mchaarawi @jolivier23 @NiuYawei do we need one more complete execution of all tests or the actual validation status is good enough?

I would like to see this PR being green before landing. The history with all that went in is just not easy to stitch together to understand. please merge latest master in and do not skip any tests.
there are also some build failures in gha with clang compiler that should be fixed.

@mchaarawi, @jolivier23
All tests have passed.
https://build.hpdd.intel.com/blue/organizations/jenkins/daos-stack%2Fdaos/detail/PR-14923/62/pipeline

Skip-list: test_ior_intercept_libpil4dfs:DAOS-16260

Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@hpe.com>
@@ -41,6 +41,29 @@ static void
pmdk_log_function(enum pmemobj_log_level level, const char *file_name, unsigned line_no,
const char *function_name, const char *message)
{
/* normalize file path - remove leading "../" */
while ((*file_name == '.') && (*(file_name + 1) == '.') && (*(file_name + 2) == '/')) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, won't this happen even if the log is disabled? Maybe put this in a function and change PMDK_LOG_NOCHECK to a do/while(0) and do this conversion inside the macro?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can do that, but PMDK produces only error/warning messages which should not be disabled at all.

Copy link
Contributor

@jolivier23 jolivier23 left a comment

Choose a reason for hiding this comment

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

I think this needs to be updated to put the string conversions inside the macro..unless I'm missing something

Fixed in 7d52d54

Skip-list: test_ior_intercept_libpil4dfs:DAOS-16260

Skip-func-hw-test: true

Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@hpe.com>
jolivier23
jolivier23 previously approved these changes Mar 12, 2025
/* Prefix is needed to filter out PMDK messages in NLT results analysis */ \
/* as it is implemented in https://github.com/daos-stack/pipeline-lib/pull/457 */ \
\
char file_name_buff[PMDK_LOG_FUNCTION_MAX_FILENAME] = "pmdk/"; \
Copy link
Contributor

Choose a reason for hiding this comment

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

minor nit, we usually put declarations at the top of the current block.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in: 4f2622c

Fix: put declarations at the top of the current block

Skip-list: test_ior_intercept_libpil4dfs:DAOS-16260

Skip-func-hw-test: true

Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@hpe.com>
@grom72 grom72 requested a review from a team March 13, 2025 07:05
@grom72
Copy link
Contributor Author

grom72 commented Mar 13, 2025

@daos-stack/daos-gatekeeper
Full validation has been done for 7d52d54 - only three ARM builds failed due to missing ARM self-hosted runners. There is a PR #15995 awaiting review that temporarily disables ARM related workflows until we rebuild ARM support in our lab.
The last two commits do not have full validation (Test Hardware excluded), as the latest changes cannot affect those tests in any way. Validation has focused on basic build and functional testing only.

Skip-list: test_ior_intercept_libpil4dfs:DAOS-16260

Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@hpe.com>
@daltonbohning
Copy link
Contributor

Unfortunately the latest builds are failing due to a CI issue resolved yesterday. But there is another CI issue #16125 you'll want to wait for too.
And this PR has conflicts now :(

@daltonbohning daltonbohning removed the request for review from a team March 19, 2025 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

7 participants