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

Duplicate key error E11000 doesn't show the key name on ephemeralForTest storage engine

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Duplicate
    • None
    • None
    • Storage
    • ALL
    • Storage NYC 2018-09-24

    Description

      This is the error message in Wiredtiger:

      "errmsg" : "E11000 duplicate key error collection: test.some_col index: user_id_1 dup key: { : 1.0 }"

      and this in ephemeralForTest:

      "errmsg" : "E11000 duplicate key error dup key: { : 1.0 }"

      The source code shows that adding the _indexName to the error string is marked as TODO.

      // taken from btree_logic.cpp
      Status dupKeyError(const BSONObj& key) {
          StringBuilder sb;
          sb << "E11000 duplicate key error ";
          // sb << "index: " << _indexName << " "; // TODO
          sb << "dup key: " << key;
          return Status(ErrorCodes::DuplicateKey, sb.str());
      }

      Thanks

      Attachments

        Issue Links

          Activity

            People

              xiangyu.yao@mongodb.com Xiangyu Yao (Inactive)
              miguel.nieto@mongodb.com Miguel Angel Nieto
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: