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

Improve compression negotiation logging

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.5.8
    • Affects Version/s: None
    • Component/s: Networking
    • Labels:
      None
    • Fully Compatible
    • Platforms 2017-05-08, Platforms 2017-05-29

      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

      Unable to find source-code formatter for language: log. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      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:

      Unable to find source-code formatter for language: log. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      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.)

            Assignee:
            jonathan.reams@mongodb.com Jonathan Reams
            Reporter:
            bjori Hannes Magnusson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: