Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-60737

Remove incorrect chunk timestamp check from ShardServerCatalogCacheLoaderTest

    XMLWordPrintable

Details

    • Task
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 5.0.0
    • 5.0.4
    • Sharding
    • None
    • Fully Compatible
    • Sharding EMEA 2021-10-18
    • 50

    Description

      This assert in ShardServerCatalogCacheLoaderTest_PrimaryLoadFromShardedWithChangeOnMetadataFormatBecauseUpgrade is incorrect. Under particular interleaving of the unit test thread and ShardServerCatalogCacheLoader thread, it is can fail.

      The test sets up a situation where the SSCCL has seen some chunks with their 'timestamp' field set, but the collection entry still without 'timestamp'. Later, the test expects the SSCCL to return the 'timestamp' set for those chunks that had it. This only works if the SSCCL has not persisted the chunks to disk yet (and in practice, in the test is very likely to not have persisted it).

      If the SSCCL had time to persist the disk, it would have done it without the timestamp (as expected). Upon reading, the SSCCL will read the persisted chunks, then[ if the persisted collection had 'timestamp', it would add the 'timestamp' to the chunks|https://github.com/mongodb/mongo/blob/0d369af9f5be858fb06ed7c8013e05365288dcb0/src/mongo/db/s/shard_metadata_util.cpp#L302]. In the situation of the test, the collection still does not have 'timestamp', so the returned chunks wouldn't have it.

      This is the expected behavior of the SSCCL, so the check needs to be removed.

      Attachments

        Activity

          People

            jordi.serra-torrens@mongodb.com Jordi Serra Torrens
            jordi.serra-torrens@mongodb.com Jordi Serra Torrens
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: