Skip to content

HDDS-11703. xcompat audit logs are overwritten #8279

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

peterxcli
Copy link
Member

@peterxcli peterxcli commented Apr 14, 2025

What changes were proposed in this pull request?

Audit logs are saved when shutting down Docker Compose cluster during tests. xcompat starts/stops a cluster for each version being tested. Audit logs from each run overwrite those from previous run.

We should assign a unique prefix or suffix to each run's audit logs to prevent overwrites.


For compact old:
create a subdir for each ${cluster_version}-${current_version}

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-11703

How was this patch tested?

CI:
https://github.com/peterxcli/ozone/actions/runs/14438720856

compact old:

'result/xcompat/old/xcompat/old/1.1.0-2.1.0/dn-audit-dn.log' -> '/home/runner/work/ozone/ozone/target/acceptance/xcompat/old/xcompat/old/1.1.0-2.1.0/dn-audit-dn.log'
'result/xcompat/old/xcompat/old/1.1.0-2.1.0/kms-audit.log' -> '/home/runner/work/ozone/ozone/target/acceptance/xcompat/old/xcompat/old/1.1.0-2.1.0/kms-audit.log'
'result/xcompat/old/xcompat/old/1.1.0-2.1.0/om-audit-om.log' -> '/home/runner/work/ozone/ozone/target/acceptance/xcompat/old/xcompat/old/1.1.0-2.1.0/om-audit-om.log'
'result/xcompat/old/xcompat/old/1.1.0-2.1.0/om-sys-audit-om.log' -> '/home/runner/work/ozone/ozone/target/acceptance/xcompat/old/xcompat/old/1.1.0-2.1.0/om-sys-audit-om.log'
'result/xcompat/old/xcompat/old/1.1.0-2.1.0/scm-audit-scm.log' -> '/home/runner/work/ozone/ozone/target/acceptance/xcompat/old/xcompat/old/1.1.0-2.1.0/scm-audit-scm.log'

...

'result/xcompat/old/xcompat/old/1.2.1-2.1.0/dn-audit-dn.log' -> '/home/runner/work/ozone/ozone/target/acceptance/xcompat/old/xcompat/old/1.2.1-2.1.0/dn-audit-dn.log'
'result/xcompat/old/xcompat/old/1.2.1-2.1.0/kms-audit.log' -> '/home/runner/work/ozone/ozone/target/acceptance/xcompat/old/xcompat/old/1.2.1-2.1.0/kms-audit.log'
'result/xcompat/old/xcompat/old/1.2.1-2.1.0/om-audit-om.log' -> '/home/runner/work/ozone/ozone/target/acceptance/xcompat/old/xcompat/old/1.2.1-2.1.0/om-audit-om.log'
'result/xcompat/old/xcompat/old/1.2.1-2.1.0/om-sys-audit-om.log' -> '/home/runner/work/ozone/ozone/target/acceptance/xcompat/old/xcompat/old/1.2.1-2.1.0/om-sys-audit-om.log'
'result/xcompat/old/xcompat/old/1.2.1-2.1.0/scm-audit-scm.log' -> '/home/runner/work/ozone/ozone/target/acceptance/xcompat/old/xcompat/old/1.2.1-2.1.0/scm-audit-scm.log'

...

'result/xcompat/old/xcompat/old/1.3.0-2.1.0/dn-audit-dn.log' -> '/home/runner/work/ozone/ozone/target/acceptance/xcompat/old/xcompat/old/1.3.0-2.1.0/dn-audit-dn.log'
'result/xcompat/old/xcompat/old/1.3.0-2.1.0/kms-audit.log' -> '/home/runner/work/ozone/ozone/target/acceptance/xcompat/old/xcompat/old/1.3.0-2.1.0/kms-audit.log'
'result/xcompat/old/xcompat/old/1.3.0-2.1.0/om-audit-om.log' -> '/home/runner/work/ozone/ozone/target/acceptance/xcompat/old/xcompat/old/1.3.0-2.1.0/om-audit-om.log'
'result/xcompat/old/xcompat/old/1.3.0-2.1.0/om-sys-audit-om.log' -> '/home/runner/work/ozone/ozone/target/acceptance/xcompat/old/xcompat/old/1.3.0-2.1.0/om-sys-audit-om.log'
'result/xcompat/old/xcompat/old/1.3.0-2.1.0/s3g-audit-s3g.log' -> '/home/runner/work/ozone/ozone/target/acceptance/xcompat/old/xcompat/old/1.3.0-2.1.0/s3g-audit-s3g.log'
'result/xcompat/old/xcompat/old/1.3.0-2.1.0/scm-audit-scm.log' -> '/home/runner/work/ozone/ozone/target/acceptance/xcompat/old/xcompat/old/1.3.0-2.1.0/scm-audit-scm.log'

...

'result/xcompat/old/xcompat/old/1.4.0-2.1.0/dn-audit-dn.log' -> '/home/runner/work/ozone/ozone/target/acceptance/xcompat/old/xcompat/old/1.4.0-2.1.0/dn-audit-dn.log'
'result/xcompat/old/xcompat/old/1.4.0-2.1.0/kms-audit.log' -> '/home/runner/work/ozone/ozone/target/acceptance/xcompat/old/xcompat/old/1.4.0-2.1.0/kms-audit.log'
'result/xcompat/old/xcompat/old/1.4.0-2.1.0/om-audit-om.log' -> '/home/runner/work/ozone/ozone/target/acceptance/xcompat/old/xcompat/old/1.4.0-2.1.0/om-audit-om.log'
'result/xcompat/old/xcompat/old/1.4.0-2.1.0/om-sys-audit-om.log' -> '/home/runner/work/ozone/ozone/target/acceptance/xcompat/old/xcompat/old/1.4.0-2.1.0/om-sys-audit-om.log'
'result/xcompat/old/xcompat/old/1.4.0-2.1.0/s3g-audit-s3g.log' -> '/home/runner/work/ozone/ozone/target/acceptance/xcompat/old/xcompat/old/1.4.0-2.1.0/s3g-audit-s3g.log'
'result/xcompat/old/xcompat/old/1.4.0-2.1.0/scm-audit-scm.log' -> '/home/runner/work/ozone/ozone/target/acceptance/xcompat/old/xcompat/old/1.4.0-2.1.0/scm-audit-scm.log'

...

'result/xcompat/old/xcompat/old/1.4.1-2.1.0/dn-audit-dn.log' -> '/home/runner/work/ozone/ozone/target/acceptance/xcompat/old/xcompat/old/1.4.1-2.1.0/dn-audit-dn.log'
'result/xcompat/old/xcompat/old/1.4.1-2.1.0/kms-audit.log' -> '/home/runner/work/ozone/ozone/target/acceptance/xcompat/old/xcompat/old/1.4.1-2.1.0/kms-audit.log'
'result/xcompat/old/xcompat/old/1.4.1-2.1.0/om-audit-om.log' -> '/home/runner/work/ozone/ozone/target/acceptance/xcompat/old/xcompat/old/1.4.1-2.1.0/om-audit-om.log'
'result/xcompat/old/xcompat/old/1.4.1-2.1.0/om-sys-audit-om.log' -> '/home/runner/work/ozone/ozone/target/acceptance/xcompat/old/xcompat/old/1.4.1-2.1.0/om-sys-audit-om.log'
'result/xcompat/old/xcompat/old/1.4.1-2.1.0/s3g-audit-s3g.log' -> '/home/runner/work/ozone/ozone/target/acceptance/xcompat/old/xcompat/old/1.4.1-2.1.0/s3g-audit-s3g.log'
'result/xcompat/old/xcompat/old/1.4.1-2.1.0/scm-audit-scm.log' -> '/home/runner/work/ozone/ozone/target/acceptance/xcompat/old/xcompat/old/1.4.1-2.1.0/scm-audit-scm.log'

@ivandika3 ivandika3 requested a review from adoroszlai April 15, 2025 01:16
Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

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

Thanks @peterxcli for the patch. Unfortunately the fix does not seem this simple.

test-old.sh is invoked as: test-all.sh -> run_test_scripts -> run_test_script -> test-old.sh

copy_results (invoked by run_test_scripts) expects Robot results in the immediate subdir, so now combined XML report and log.html are missing from the artifact:

if [[ -n "$(find "${result_dir}" -mindepth 1 -maxdepth 1 -name "*.xml")" ]]; then

It also hard-codes result as the result dir:

local result_dir="${test_dir}/result"

We could use $RESULT_DIR here, but RESULT_DIR from the shell script is not visible for the function (because it is executed in new shell, not source-d).

if ! ./"$test_script"; then

@@ -26,5 +26,6 @@ source "${COMPOSE_DIR}/lib.sh"
# old cluster with clients: same version and current version
for cluster_version in ${old_versions}; do
export OZONE_VERSION=${cluster_version}
export RESULT_DIR="${COMPOSE_DIR}/result/xcompat/old/${cluster_version}-${current_version}"
Copy link
Contributor

Choose a reason for hiding this comment

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

xcompat/old can be omitted, now it is duplicated in the directory structure.

@adoroszlai adoroszlai marked this pull request as draft April 16, 2025 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants