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

Couch att erroneous md5 mismatch #3271

Merged
merged 1 commit into from Nov 16, 2020
Merged

Conversation

rnewson
Copy link
Member

@rnewson rnewson commented Nov 16, 2020

Overview

If an attachment was stored uncompressed but later is replicated
internally to a node that wants to compress it (based on
content-type), couchdb compares the uncompressed md5 with the
compressed md5 and fails. This breaks eventual consistency between
replicas.

This PR removes the unnecessary MD5 check that is, in these specific
circumstances, always called with mismatched arguments.

Testing recommendations

  1. Upload an attachment with a content-type not included in compressible_type config
  2. change compressible_type to include this content-type
  3. stop a node
  4. delete the hosting shard of the attachment
  5. start the node.
  6. observe md5_mismatch errors in the log.

Related Issues or Pull Requests

N/A

Checklist

  • Code is written and works correctly
  • Changes are covered by tests
  • Any new configurable parameters are documented in rel/overlay/etc/default.ini
  • A PR for documentation changes has been made in https://github.com/apache/couchdb-documentation

If an attachment was stored uncompressed but later is replicated
internally to a node that wants to compress it (based on
content-type), couchdb compares the uncompressed md5 with the
compressed md5 and fails. This breaks eventual consistency between
replicas.

This PR removes the unnecessary MD5 check that is, in these specific
circumstances, always called with mismatched arguments.
@rnewson rnewson changed the base branch from main to 3.x November 16, 2020 20:45
@davisp
Copy link
Member

davisp commented Nov 16, 2020

To be clear, the check that's being removed is both incorrect and redundant. There's a compression aware check that happens inside the couch_db:with_stream function so even if this check had been correct it would still be redundant.

@rnewson rnewson merged commit 87a6b1a into 3.x Nov 16, 2020
@rnewson rnewson deleted the couch_att_erroneous_md5_mismatch branch November 16, 2020 21:25
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.

None yet

2 participants