compact with a large freeSpaceTargetMB stops the server

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: 8.2.4, 8.2.6, 8.2.12
    • Component/s: None
    • None
    • Storage Engines - Foundations
    • ALL
    • Hide
      docker run -d --name repro mongo:8.2.12
      # wait for startup, then:
      docker exec repro mongosh --quiet test --eval '
        db.k.insertOne({});
        db.runCommand({compact: "k", freeSpaceTargetMB: NumberLong("8796093022208")});
      '
      docker inspect repro --format '{{.State.Status}} exit={{.State.ExitCode}}'
      

      The command returns nothing because the connection closes while it is running. The last line reports exited exit=133. The server is gone and has to be restarted.

      Show
      docker run -d --name repro mongo:8.2.12 # wait for startup, then: docker exec repro mongosh --quiet test --eval ' db.k.insertOne({}); db.runCommand({compact: "k", freeSpaceTargetMB: NumberLong("8796093022208")}); ' docker inspect repro --format '{{.State.Status}} exit={{.State.ExitCode}}' The command returns nothing because the connection closes while it is running. The last line reports exited exit=133 . The server is gone and has to be restarted.
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Passing a large freeSpaceTargetMB to compact stops the server. No error is
      returned to the client and the connection closes mid command.

      The value where this starts is 8796093022208, and one less than that works normally.

      freeSpaceTargetMB Result
      8796093022207 returns bytesFreed 0, ok 1
      8796093022208 server stops

      Other numeric types show the outcome, which suggests some kind of conversion issue before any range check happens. All of these stop the server:

      NumberLong("9223372036854775807")   // int64 max
      Infinity                            // double
      1.7976931348623157e308              // double max
      NumberDecimal("Infinity")
      NumberDecimal("1E+100")
      

      Values below the boundary and negative values are handled cleanly. -Infinity and NaN both return error 2. Only large positive values stop the server.

      Expected

      An error, or the same successful response that smaller values return. Nothing a client passes in this field should be able to stop the server.

      Actual

      The server stops. The client sees the connection close with no error code, and the
      process exits with 133.

            Assignee:
            Unassigned
            Reporter:
            Daniel Frankcom (EXT)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: