[SERVER-14467] Capture S2 debug log messages Created: 05/Jul/14  Updated: 31/Jul/15  Resolved: 08/Aug/14

Status: Closed
Project: Core Server
Component/s: Geo, Logging
Affects Version/s: None
Fix Version/s: 2.7.5

Type: Improvement Priority: Major - P3
Reporter: David Hows Assignee: Benety Goh
Resolution: Done Votes: 1
Labels: community-team
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-5092 Better named logging with tracing Closed
depends on SERVER-9751 Make S2 geometry library to use Mongo... Closed
is depended on by SERVER-14894 modify S2 debug log message about int... Closed
Related
related to SERVER-13735 “Malformed geometry” error when creat... Closed
is related to SERVER-14508 Better error messages from GeoJSON pa... Closed
is related to SERVER-15550 Change "S2" log component to "Geo" Closed
Tested
Sprint: Server 2.7.4, Server 2.7.5
Participants:

 Description   

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



 Comments   
Comment by Githook User [ 08/Aug/14 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-14467 log S2 debug messages as query log message at level 5
Branch: master
https://github.com/mongodb/mongo/commit/fe950f19e616a86fdea70da66eda658d64489a5e

Generated at Thu Feb 08 03:34:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.