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

Make _opTime required (not boost::optional) in ConfigServerMetadata

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.3.4
    • Component/s: Sharding
    • Sharding 16 (06/24/16)

      v3.2 non-config shards and later always return ConfigServerMetadata in command responses, so the ConfigServerMetadata::opTime field should not be boost::optional anymore.

      1) Remove the opTime.is_initialized check from ShardingEgressMetadataHook::_advanceConfigOpTimeFromShard():

      auto opTime = configMetadata.getOpTime();
      if (opTime.is_initialized()) {
          grid.advanceConfigOpTime(opTime.get());
      }
      

      2) Make _opTime non-optional in config_server_metadata.h:

          boost::optional<repl::OpTime> getOpTime() const {
              return _opTime;
          }
      
      private:
          boost::optional<repl::OpTime> _opTime;
      

            Assignee:
            leon.zaruvinsky Leon Zaruvinsky
            Reporter:
            esha.maharishi@mongodb.com Esha Maharishi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: