- Newest
- Most votes
- Most comments
The "Modification Sync" feature ensures that changes made to replica objects are propagated back to the source object, creating a two-way synchronization. It maintains consistency between the source and destination buckets by syncing metadata changes and overwriting objects with the most recent version.
When you write the same object simultaneously to both buckets:
1. Write Operations: Each bucket (us-east-1 and us-east-2) will receive the write operation independently.
2. Replication Process: Both buckets will trigger replication for the new or modified objects as per their replication configuration. If an object with the same key is written to both buckets simultaneously, each bucket will initiate a replication operation to the other bucket.
3. Conflict Resolution: Amazon S3 does not inherently provide conflict resolution for simultaneous writes. Each bucket will try to replicate the object to the other bucket. The final state of the object will depend on which replication operation completes last. The last write wins, meaning the object version with the latest timestamp will be the final state in both buckets. S3 uses timestamps to determine the most recent version of an object, and the object with the latest timestamp will overwrite the older version.
In this scenario, S3 replication will attempt to replicate the objects, and the final version of the object will be determined by the latest timestamp. The replica modification sync feature will ensure that both buckets eventually have the same latest version of the object. However, this behavior might lead to an unintended overwrite of the object if simultaneous writes occur frequently.
To avoid conflicts, consider using mechanisms to ensure that writes are not performed simultaneously or implement application-level logic to handle such scenarios.
Relevant content
- asked 4 months ago
- asked 2 years ago
- asked 3 years ago