bucket_exceed_uncompressed_mem_limit.js builds a >200MB uncompressed bucket that the shell now rejects before insert

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.0.29, 7.0.40, 8.3.8
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Integration
    • Fully Compatible
    • ALL
    • v9.0, v8.3, v8.0, v7.0
    • 200
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Root cause

      SERVER-128347 made the shell validate BSON produced by the JS engine in ObjectWrapper::toBSON(), which enforces the bsonMaxExpandedMemUsage limit (default 200MB) on BSONColumn expansion.

      bucket_exceed_uncompressed_mem_limit.js relies on that 200MB default and builds a bucket that expands past 200MB. Both Object.bsonsize(bucketObj) and the insertOne serialize that bucket through ObjectWrapper::toBSON(), so the shell now rejects it with InvalidBSONFromJavaScript before the server is reached.

      Proposed fix

      The test should set bsonMaxExpandedMemUsage to a small value at startup rather than relying on the 200MB default and building a 200MB bucket. Set the server limit to e.g. 64KB and shrink the crafted bucket so it expands to a few hundred KB:

      • expansion < 200MB -> shell serialization passes
      • expansion > bsonMaxExpandedMemUsage -> server rejects with ExceededMemoryLimit

            Assignee:
            Aditya Deshpande
            Reporter:
            Shin Yee Tan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: