[SERVER-28986] Improve compression negotiation logging Created: 26/Apr/17  Updated: 30/Oct/23  Resolved: 30/May/17

Status: Closed
Project: Core Server
Component/s: Networking
Affects Version/s: None
Fix Version/s: 3.5.8

Type: Improvement Priority: Major - P3
Reporter: Hannes Magnusson Assignee: Jonathan Reams
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-28831 Log which compressor is being used fo... Closed
Backwards Compatibility: Fully Compatible
Sprint: Platforms 2017-05-08, Platforms 2017-05-29
Participants:

 Description   

It'd be nice if we could add couple of more log statements during the compression negotiation. It would make it easier for drivers to know if they are actually even triggering the negotiation during development, and also for users to identify drivers that didn't even attempt to negotiate compression (likely due to not supporting it).

When client and server don't agree on any compressors, it'd be nice to add a log line stating that

2017-04-26T12:03:16.660-0700 D COMMAND  [conn8] run command admin.$cmd { isMaster: 1, client: { driver: { name: "mongoc", version: "1.7.0-dev" }, os: { type: "Linux", name: "Ubuntu", version: "17.04", architecture: "x86_64" }, platform: "cfg=0x1eb8e9 posix=200809 stdc=201112 CC=GCC 6.3.0 20170406 CFLAGS="" LDFLAGS=""" }, compression: [ "snappy" ] }
2017-04-26T12:03:16.660-0700 I NETWORK  [conn8] received client metadata from 127.0.0.1:52460 conn8: { driver: { name: "mongoc", version: "1.7.0-dev" }, os: { type: "Linux", name: "Ubuntu", version: "17.04", architecture: "x86_64" }, platform: "cfg=0x1eb8e9 posix=200809 stdc=201112 CC=GCC 6.3.0 20170406 CFLAGS="" LDFLAGS=""" }
2017-04-26T12:03:16.661-0700 D NETWORK  [conn8] Starting server-side compression negotiation
2017-04-26T12:03:16.661-0700 D NETWORK  [conn8] snappy is not supported
2017-04-26T12:03:16.661-0700 D NETWORK  [conn8] Could not agree on compressor to use
2017-04-26T12:03:16.661-0700 I COMMAND  [conn8] command admin.$cmd command: isMaster { isMaster: 1, client: { driver: { name: "mongoc", version: "1.7.0-dev" }, os: { type: "Linux", name: "Ubuntu", version: "17.04", architecture: "x86_64" }, platform: "cfg=0x1eb8e9 posix=200809 stdc=201112 CC=GCC 6.3.0 20170406 CFLAGS="" LDFLAGS=""" }, compression: [ "snappy" ] } numYields:0 reslen:189 locks:{} protocol:op_query 0ms

Likewise, when the client simply didn't attempt to negotiate compression:

2017-04-26T12:02:10.766-0700 D COMMAND  [conn7] run command admin.$cmd { isMaster: 1, client: { driver: { name: "mongoc", version: "1.7.0-dev" }, os: { type: "Linux", name: "Ubuntu", version: "17.04", architecture: "x86_64" }, platform: "cfg=0x1eb8e9 posix=200809 stdc=201112 CC=GCC 6.3.0 20170406 CFLAGS="" LDFLAGS=""" } }
2017-04-26T12:02:10.766-0700 I NETWORK  [conn7] received client metadata from 127.0.0.1:52428 conn7: { driver: { name: "mongoc", version: "1.7.0-dev" }, os: { type: "Linux", name: "Ubuntu", version: "17.04", architecture: "x86_64" }, platform: "cfg=0x1eb8e9 posix=200809 stdc=201112 CC=GCC 6.3.0 20170406 CFLAGS="" LDFLAGS=""" }
2017-04-26T12:02:10.766-0700 D NETWORK  [conn7] Starting server-side compression negotiation
2017-04-26T12:02:10.766-0700 D NETWORK  [conn7] No compression negotiated
2017-04-26T12:02:10.766-0700 I COMMAND  [conn7] command admin.$cmd command: isMaster { isMaster: 1, client: { driver: { name: "mongoc", version: "1.7.0-dev" }, os: { type: "Linux", name: "Ubuntu", version: "17.04", architecture: "x86_64"}, platform: "cfg=0x1eb8e9 posix=200809 stdc=201112 CC=GCC 6.3.0 20170406 CFLAGS="" LDFLAGS=""" } } numYields:0 reslen:189 locks:{} protocol:op_query 0ms

(Proposed log line additions are highlighted.)



 Comments   
Comment by Githook User [ 30/May/17 ]

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}

Message: SERVER-28986 Improve compression negotiation logging

Closes #1148

Signed-off-by: Jonathan Reams <jbreams@mongodb.com>
Branch: master
https://github.com/mongodb/mongo/commit/6a11fc05770306b5d660b21f339cba110d6d67d4

Generated at Thu Feb 08 04:19:36 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.