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

Refresh db metadata under CollectionRoutingInfoTargeter::refreshIfNeeded

    • Type: Icon: Task Task
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Catalog and Routing

      The CollectionRoutingInfoTargeter class is used by a WriteOp to target child write operations. It's also in charge of handling targeting-related errors such as StaleDbVersion and StaleConfig.

      When a StaleDbVersion is returned, the WriteOp calls the CollectionRoutingInfoTargeter::noteStaleDbResponse() which will refresh the db metadata.

      However, the CollectionRoutingInfoTargeter is also exposing a method called refreshIfNeeded() that is expected to refresh the collection routing information if the last received error is kCouldNotTarget. The refreshIfNeeded() method only refreshes the collection metadata and skips the refresh on the db metadata, which feels wrong since the db metadata is necessary to target unsharded-untracked collections.

      There is no bug due to this behavior because we are handling the StaleDbVersion through the noteStaleDbResponse() handler. However, I think we should include the db metadata refresh under the refreshIfNeeded() to avoid any future misuse of it.

            Assignee:
            Unassigned Unassigned
            Reporter:
            silvia.surroca@mongodb.com Silvia Surroca
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: