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

Capture S2 debug log messages

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.7.5
    • Affects Version/s: None
    • Component/s: Geo, Logging
    • Server 2.7.4, Server 2.7.5

      Debug log messages in the third party S2 Geometry Library (typically triggered by bad user input) are now visible in the server logs by setting the verbosity of the S2 log component to 5.

      2 ways to enable S2 debug log messages:

      • raising logLevel to 5 for all server components
        ./mongod -vvvvv"
        
      • Using the new logComponentVerbosity server parameter introduced in SERVER-14116:
        ./mongod --setParameter=logComponentVerbosity="{s2: {verbosity: 5}}"
        

      Sample logs in 2.7.5 at log level 5 generated from running jstests/core/geo_invalid_polygon.js:

      % buildscripts/smoke.py --set-parameters=logLevel=5  --mode=files jstests/core/geo_invalid_polygon.js
      2014-08-13T11:15:42.317-0400 I          [initandlisten] MongoDB starting : pid=21518 port=27999 dbpath=/data/db/sconsTests/ 64-bit host=myhost.local
      ...
      2014-08-13T11:16:01.090-0400 D S2       [conn3] Edges 0 and 2 cross
      2014-08-13T11:16:01.090-0400 D S2       [conn3] Edge locations in degrees: -1.000000,-2.000000-1.000000,1.000000 and 1.000000,0.000000-0.000000,0.000000
      2014-08-13T11:16:01.090-0400 D          [conn3] User Assertion: 16755:Can't extract geo keys from object, malformed geometry?: { _id: 42.0, geometry: { type: "Polygon", coordinates: [ [ [ 0.0, 0.0 ], [ 0.0, 1.0 ], [ 1.0, 1.0 ], [ -2.0, -1.0 ], [ 0.0, 0.0 ] ] ] } }
      ...
      2014-08-13T11:16:01.169-0400 I STORAGE  [signalProcessingThread] shutdown: closing all files...
      2014-08-13T11:16:01.169-0400 I STORAGE  [signalProcessingThread] closeAllFiles() finished
      

      ---------
      Original description:

      It is non-trivial to debug issues with Geo queries that fail due to invalid polygons.

      There are a number of very good error messages that occur within S2 that make these problems significantly easier to debug.

      Can we find a way to capture these S2 logs and have them pushed over to our logfiles?

      Example log line: https://github.com/mongodb/mongo/blob/master/src/third_party/s2/s2loop.cc#L110

            Assignee:
            benety.goh@mongodb.com Benety Goh
            Reporter:
            david.hows David Hows
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: