Skip to content

fix(replication): avoid persisting aws-chunked metadata - #187

Open
chodorenko wants to merge 1 commit into
pgsty:mainfrom
chodorenko:fix/replication-aws-chunked-metadata
Open

chodorenko wants to merge 1 commit into
pgsty:mainfrom
chodorenko:fix/replication-aws-chunked-metadata

Conversation

@chodorenko

@chodorenko chodorenko commented Sep 14, 2026

Copy link
Copy Markdown

Contribution Licensing (no CLA, inbound=outbound, DCO required)

This pull request contributes to PGSTY SILO (pgsty/silo). Code contributions
are accepted under AGPL-3.0-or-later, the same license as the server.
This project does not use a CLA or require a separate Apache-2.0 license grant.
By submitting this pull request I represent that I have the right to contribute
the code changes under this repository's
GNU Affero General Public License v3.0 or later
and retain copyright in my original work. Existing copyright and license
notices remain intact; separately licensed material keeps its applicable terms.
Every commit must carry a DCO Signed-off-by trailer
(git commit -s) certifying the
Developer Certificate of Origin — see
CONTRIBUTING.md.

Description

Avoid persisting the SigV4 streaming transport header Content-Encoding: aws-chunked as replica object metadata.

The trusted-replication path restored all supported headers after the ordinary metadata parser had normalized them. That reintroduced the raw transport encoding, although the source object has no content encoding.

This change restores only replication-only headers after trust validation and leaves normalized ordinary metadata intact.

Motivation and Context

Replicated objects can advertise Content-Encoding: aws-chunked even though their bytes were never content-encoded. S3 clients consuming GET/HEAD responses from the replica may try to decode those bytes incorrectly.

How to test this PR?

go test ./cmd -run 'Test(ExtractMetadataHeaders|ExtractReplicationMetadataHeaders|GetCopyObjectMetadataFromHeaderReplication)' -count=1
go build -o /private/tmp/silo-aws-chunked-fix .

The updated regression test supplies trusted replication headers plus Content-Encoding: aws-chunked, and verifies that the stored metadata has no content-encoding while replication-only fields are preserved.

Compatibility impact

No API or configuration changes. Newly replicated objects no longer retain the invalid transport encoding in metadata. Existing objects with this metadata are not modified.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Optimization (provides speedup with no functional changes)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • All commits are signed off (git commit -s) per the DCO
  • Fixes a regression: 56fa63b
  • Unit tests added/updated
  • make verifiers passes
  • Relevant package tests and go build pass
  • Compatibility and rollback impact documented
  • Internal documentation updated
  • Public documentation update opened in pgsty/silo.pgsty.com, if needed

fix for #185

Signed-off-by: Mikhail Khadarenka <chodorenko@gmail.com>
@chodorenko chodorenko closed this Sep 14, 2026
@chodorenko
chodorenko deleted the fix/replication-aws-chunked-metadata branch September 14, 2026 16:16
@chodorenko
chodorenko restored the fix/replication-aws-chunked-metadata branch September 14, 2026 16:18
@chodorenko chodorenko reopened this Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant