collMod with cappedSize or cappedMax on a view stops the server

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: 8.2.4, 7.0.31, 8.2.6, 8.2.12
    • Component/s: None
    • None
    • ALL
    • Hide
      docker run -d --name repro mongo:8.2.12
      
      # wait for startup, then:
      docker exec repro mongosh --quiet test --eval '
        db.createCollection("v", {viewOn: "nonexistent"});
        db.runCommand({collMod: "v", cappedSize: 1});
      '
      
      docker inspect repro --format '{{.State.Status}} exit={{.State.ExitCode}}'
      

      The last line reports exited exit=139. The server is gone and has to be restarted.
      cappedMax in place of cappedSize does the same thing.

      Show
      docker run -d --name repro mongo:8.2.12 # wait for startup, then: docker exec repro mongosh --quiet test --eval ' db.createCollection("v", {viewOn: "nonexistent"}); db.runCommand({collMod: "v", cappedSize: 1}); ' docker inspect repro --format '{{.State.Status}} exit={{.State.ExitCode}}' The last line reports exited exit=139 . The server is gone and has to be restarted. cappedMax in place of cappedSize does the same thing.
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Running collMod with either capped resize option against a view stops the server. No
      error is returned and the connection closes.

      The view does not need a real source collection or a pipeline, and the value can be 1.

      Every other target returns a clean error for the same options.

      Target Result
      ordinary collection error 72, Collection must be capped
      clustered collection error 72
      oplog error 72, cannot resize the oplog using this command
      non-existent collection error 26, ns does not exist
      view server stops

      Expected

      Error 72 InvalidOptions, matching the ordinary collection case. A view has no
      underlying collection to resize.

      Actual

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

      cappedSize and cappedMax give the same exit code on every version I tried.

            Assignee:
            Noopur Gupta
            Reporter:
            Daniel Frankcom (EXT)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: