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

Avoid storing db name in two fields of DatabaseName

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

      Db name of the database is stored in two fields of DatabaseName. 

      • _dbName,  it holds the db name
      • _tenantDbName, it holds the tenant id and db name in one string when a tenant id is assigned.

      In this ticket, we will redesign the internal data struct to have the db name only be stored in one place, such as _name. This field will hold a string with

      •  <tenant id>_<db name>, if tenant id is assigned.
      •  <db name>, otherwise.

      Also, add a field to store the start index of db name and change the implementations of related functions, for example
      StringData dbName() {
      return StringData(_name.c_str() + _dbIndex, _tenantDbName.size());
      }

      As a part of this ticket, also remove createSystemTenantDbName - we are not currently using it anywhere and it breaks convention as it takes in a string without a tenantId or a separate tenantId param.

            Assignee:
            sophia.tan@mongodb.com Sophia Tan
            Reporter:
            sophia.tan@mongodb.com Sophia Tan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: