[9.3](backport #49734) Fix: Implement backup_to_bucket_ and delete_after_backup for aws-s3 polling mode#51851
Conversation
…olling mode (#49734) * Fix: Implement backup_to_bucket_ and delete_after_backup for aws-s3 polling mode * add changelog * fix linting errors * Remove status update in every failure (cherry picked from commit e3ddd67) # Conflicts: # x-pack/filebeat/input/awss3/s3_input.go # x-pack/filebeat/input/awss3/s3_test.go
|
Cherry-pick of e3ddd67 has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
🤖 GitHub commentsJust comment with:
|
|
Pinging @elastic/obs-ds-hosted-services (Team:obs-ds-hosted-services) |
|
This pull request has not been merged yet. Could you please review and merge it @MichaelKatsoulis? 🙏 |
|
Caution agentic threat detected TL;DRThe Ubuntu Remediation
Investigation detailsRoot CauseThe failed lint step reports a Evidence
Validation
Follow-upAfter applying the assertion change, rerun the workflow and confirm all platform jobs complete successfully. What is this? | From workflow: PR Actions Detective Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. |
When Filebeat
aws-s3input runs in polling mode (e.g.non_aws_bucket_namefor MinIO/S3-compatible), it can fully process an object (events published and registry state stored) but never performbackup_to_bucket_*anddelete_after_backup.User-visible symptom
stored: true.CopyObject/DeleteObjectcalls for the processed object.Root cause (bug)
Object finalization (backup/delete) is implemented in
(*s3ObjectProcessor).FinalizeS3Object()ins3_objects.go.sqs_s3_event.go),FinalizeS3Object()is collected and executed after successful processing / ACK.s3_input.go), the ACK callback used to only checkpoint state (in.registry.AddState(state)) and increment metrics. It did not callFinalizeS3Object().As a result, polling mode could mark objects as completed in the registry without ever copying/deleting them.
Fix
In
s3_input.go(poller worker loop), callFinalizeS3Object()inside the ACK callback after all events for the object are ACKed, and only when processing succeeded (state.Stored == true).Checklist
stresstest.shscript to run them under stress conditions and race detector to verify their stability../changelog/fragmentsusing the changelog tool.Disruptive User Impact
None. It fixes the problem.
How to test this PR locally
Related issues
Use cases
Screenshots
Logs
This is an automatic backport of pull request #49734 done by [Mergify](https://mergify.com).