Skip to content
Success

Changes

Summary

  1. fix(ticdc): skip empty log archive in integration pipelines (#4162) (commit: cadf792) (details)
Commit cadf792232660895bebcb5f4bfad1d54317e6bac by noreply
fix(ticdc): skip empty log archive in integration pipelines (#4162)

## Summary

- fix log collection in TiCDC integration pipelines when
`/tmp/tidb_cdc_test/` contains no `*.log`
- replace direct `tar ... $(find ... '*.log')` with a guarded flow:
  - collect log file list first
  - only run `tar` when list is non-empty
  - print a skip message when no logs are found
- apply the same behavior across:
  - `pipelines/pingcap/ticdc/latest/*`
  - `pipelines/pingcap/ticdc/latest/*_next_gen/*`
  - `pipelines/pingcap/ticdc/release-9.0-beta/*`

## Root Cause

When `find` returns an empty result, `tar` is called without input files
and exits with:

- `tar: Cowardly refusing to create an empty archive`
- exit code `2`

This causes the post-failure log collection step to fail unexpectedly.

## Testing

- reproduced old behavior locally: empty log directory + original `tar`
invocation returns exit code `2`
- verified new guarded snippet behavior:
  - no log files: step exits normally and prints skip message
  - with log files: tarball is created successfully
- pre-commit hooks passed during commit

---------

Signed-off-by: tenfyzhong <tenfy@tenfy.cn>
(commit: cadf792)
The file was modifiedpipelines/pingcap/ticdc/latest/pull_cdc_pulsar_integration_heavy/pipeline.groovy (diff)
The file was modifiedpipelines/pingcap/ticdc/latest/pull_cdc_storage_integration_light/pipeline.groovy (diff)
The file was modifiedpipelines/pingcap/ticdc/latest/pull_cdc_kafka_integration_light/pipeline.groovy (diff)
The file was modifiedpipelines/pingcap/ticdc/latest/pull_cdc_pulsar_integration_light_next_gen/pipeline.groovy (diff)
The file was modifiedpipelines/pingcap/ticdc/release-9.0-beta/pull_cdc_pulsar_integration_light.groovy (diff)
The file was modifiedprow-jobs/pingcap/ticdc/latest-presubmits-next-gen.yaml (diff)
The file was modifiedpipelines/pingcap/ticdc/latest/pull_cdc_mysql_integration_light/pipeline.groovy (diff)
The file was modifiedpipelines/pingcap/ticdc/latest/pull_cdc_mysql_integration_heavy_next_gen/pipeline.groovy (diff)
The file was modifiedpipelines/pingcap/ticdc/latest/pull_cdc_kafka_integration_heavy_next_gen/pipeline.groovy (diff)
The file was modifiedpipelines/pingcap/ticdc/latest/pull_cdc_kafka_integration_light_next_gen/pipeline.groovy (diff)
The file was modifiedpipelines/pingcap/ticdc/release-9.0-beta/pull_cdc_kafka_integration_heavy.groovy (diff)
The file was modifiedpipelines/pingcap/ticdc/latest/pull_cdc_pulsar_integration_light/pipeline.groovy (diff)
The file was modifiedpipelines/pingcap/ticdc/release-9.0-beta/pull_cdc_kafka_integration_light.groovy (diff)
The file was modifiedpipelines/pingcap/ticdc/release-9.0-beta/pull_cdc_mysql_integration_light.groovy (diff)
The file was modifiedpipelines/pingcap/ticdc/release-9.0-beta/pull_cdc_storage_integration_light.groovy (diff)
The file was modifiedpipelines/pingcap/ticdc/release-9.0-beta/pull_cdc_storage_integration_heavy.groovy (diff)
The file was modifiedpipelines/pingcap/ticdc/release-9.0-beta/pull_cdc_mysql_integration_heavy.groovy (diff)
The file was modifiedpipelines/pingcap/ticdc/latest/pull_cdc_kafka_integration_heavy/pipeline.groovy (diff)
The file was modifiedpipelines/pingcap/ticdc/latest/pull_cdc_pulsar_integration_heavy_next_gen/pipeline.groovy (diff)
The file was modifiedpipelines/pingcap/ticdc/latest/pull_cdc_storage_integration_heavy_next_gen/pipeline.groovy (diff)
The file was modifiedpipelines/pingcap/ticdc/latest/pull_cdc_mysql_integration_light_next_gen/pipeline.groovy (diff)
The file was modifiedpipelines/pingcap/ticdc/latest/pull_cdc_mysql_integration_heavy/pipeline.groovy (diff)
The file was modifiedpipelines/pingcap/ticdc/latest/pull_cdc_storage_integration_heavy/pipeline.groovy (diff)
The file was modifiedpipelines/pingcap/ticdc/latest/pull_cdc_storage_integration_light_next_gen/pipeline.groovy (diff)