[SERVER-71479] Merging chunks must not set `validAfter` to the current wall time Created: 18/Nov/22  Updated: 29/Oct/23  Resolved: 05/Dec/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.0.4, 6.3.0-rc0

Type: Bug Priority: Major - P3
Reporter: Pierlauro Sciarelli Assignee: Silvia Surroca
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v6.2, v6.1, v6.0, v5.0
Sprint: Sharding EMEA 2022-11-28, Sharding EMEA 2022-12-12
Participants:

 Description   

When two or more contiguous chunks belonging to the same shards are being merged, the shard is sending to the config server a validAfter field set to the current time.

This is wrong because merging is not implying any ownership change.

Setting an unnecessary value for validAfter has the side effect of potentially breaking snapshot reads.

Example assuming history window of 300 seconds:

  • Contiguous chunks A-B-C have never been migrated, so their history is empty
  • A merge is called for such chunks at time 100
  • The new chunk will have validAfter: 100
  • A snapshot read arrives at time 99: it can't be served because the pre-100 history is missing, even if it was empty.

Purpose of this ticket is to set the validAfter field to the higher validAfter belonging to one of the chunks to merge or - in case of empty history on all of them - not setting it.



 Comments   
Comment by Githook User [ 03/Jan/23 ]

Author:

{'name': 'Silvia Surroca', 'email': 'silvia.surroca@mongodb.com', 'username': 'silviasuhu'}

Message: SERVER-71479 Merging chunks must not set `validAfter` to the current wall time
Branch: v6.0
https://github.com/mongodb/mongo/commit/e2dc8a74fa2d708cc560fb79c29c60cbce4e659a

Comment by Githook User [ 05/Dec/22 ]

Author:

{'name': 'Pierlauro Sciarelli', 'email': 'pierlauro.sciarelli@mongodb.com', 'username': 'pierlauro'}

Message: SERVER-71479 Merging chunks must not set `validAfter` to the current wall time
Branch: master
https://github.com/mongodb/mongo/commit/d3af256f1a2a07aefdeb18a9af12c08763bd8b21

Generated at Thu Feb 08 06:19:07 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.