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

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Storage
    • ALL
    • Storage NYC 2018-09-24

      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

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

              Created:
              Updated:
              Resolved: