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

Change _id format in local.startup_log collection to avoid duplicate key errors in systems missing RTC

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Admin, Diagnostics
    • None
    • Server Security

      We are running mongod on an embedded device (sounds weird, I know...), and since we have no RTC on the device, it always starts from epoch.

      This makes the logging at startup likely to fail after a few boots, since the _id key is constructed from the system hostname appended with the milliseconds since epoch:
      https://github.com/mongodb/mongo/blob/master/src/mongo/db/db.cpp#L215

      Would it be possible to make the index key an auto incremented value or something similar?

      Until now, I have mitigated the problem by removing the startup logging entirely from db/db.cpp:
      https://github.com/mongodb/mongo/blob/master/src/mongo/db/db.cpp#L647

      Can this cause be problems in other conexts?

            Assignee:
            backlog-server-security [DO NOT USE] Backlog - Security Team
            Reporter:
            mnhu Martin Hundebøll
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated: