Skip to content
This repository was archived by the owner on Dec 22, 2021. It is now read-only.

Conversation

@TBSliver
Copy link
Contributor

@TBSliver TBSliver commented Jul 2, 2018

WIP for PERL-897 ticket. Includes minor fix for CommandMonitoring exploding on BSON::Doc objects.

Debug from console run of the test thats failing (see t/database.t TODO):

$ ./mongodb/mongodb-linux-x86_64-debian81-4.0.0/bin/mongo
MongoDB shell version v4.0.0
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 4.0.0
Server has startup warnings:
2018-07-02T15:09:17.706+0100 I STORAGE  [initandlisten]
2018-07-02T15:09:17.706+0100 I STORAGE  [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2018-07-02T15:09:17.706+0100 I STORAGE  [initandlisten] **          See http://dochub.mongodb.org/core/prodnotes-filesystem
2018-07-02T15:09:19.672+0100 I CONTROL  [initandlisten]
2018-07-02T15:09:19.672+0100 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
2018-07-02T15:09:19.672+0100 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
2018-07-02T15:09:19.672+0100 I CONTROL  [initandlisten]
2018-07-02T15:09:19.672+0100 I CONTROL  [initandlisten] ** WARNING: This server is bound to localhost.
2018-07-02T15:09:19.672+0100 I CONTROL  [initandlisten] **          Remote systems will be unable to connect to this server.
2018-07-02T15:09:19.672+0100 I CONTROL  [initandlisten] **          Start the server with --bind_ip <address> to specify which IP
2018-07-02T15:09:19.672+0100 I CONTROL  [initandlisten] **          addresses it should serve responses from, or with --bind_ip_all to
2018-07-02T15:09:19.672+0100 I CONTROL  [initandlisten] **          bind to all interfaces. If this behavior is desired, start the
2018-07-02T15:09:19.672+0100 I CONTROL  [initandlisten] **          server with --bind_ip 127.0.0.1 to disable this warning.
2018-07-02T15:09:19.672+0100 I CONTROL  [initandlisten]
2018-07-02T15:09:19.672+0100 I CONTROL  [initandlisten]
2018-07-02T15:09:19.672+0100 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2018-07-02T15:09:19.672+0100 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2018-07-02T15:09:19.672+0100 I CONTROL  [initandlisten]
---
Enable MongoDB's free cloud-based monitoring service to collect and display
metrics about your deployment (disk utilization, CPU, operation statistics,
etc).

The monitoring data will be available on a MongoDB website with a unique
URL created for you. Anyone you share the URL with will also be able to
view this page. MongoDB may use this information to make product
improvements and to suggest MongoDB products and deployment options to you.

To enable free monitoring, run the following command:
db.enableFreeMonitoring()
---

> db.listCollections
test.listCollections
> db.listCollections()
2018-07-02T15:11:24.868+0100 E QUERY    [js] TypeError: db.listCollections is not a function :
@(shell):1:1
> db.runCommand({listCollections: 1});
{
        "cursor" : {
                "id" : NumberLong(0),
                "ns" : "test.$cmd.listCollections",
                "firstBatch" : [ ]
        },
        "ok" : 1
}
> db.runCommand({create: 'test_capped', capped: true, size: 10000});
{ "ok" : 1 }
> db.runCommand({create: 'test'});
{ "ok" : 1 }
> db.runCommand({listCollections: 1});
{
        "cursor" : {
                "id" : NumberLong(0),
                "ns" : "test.$cmd.listCollections",
                "firstBatch" : [
                        {
                                "name" : "test_capped",
                                "type" : "collection",
                                "options" : {
                                        "capped" : true,
                                        "size" : 10240
                                },
                                "info" : {
                                        "readOnly" : false,
                                        "uuid" : UUID("8de7e5be-fa6e-470e-ac10-63639ed7291a")
                                },
                                "idIndex" : {
                                        "v" : 2,
                                        "key" : {
                                                "_id" : 1
                                        },
                                        "name" : "_id_",
                                        "ns" : "test.test_capped"
                                }
                        },
                        {
                                "name" : "test",
                                "type" : "collection",
                                "options" : {

                                },
                                "info" : {
                                        "readOnly" : false,
                                        "uuid" : UUID("0c97fb22-c240-4e3b-8242-7211cf974459")
                                },
                                "idIndex" : {
                                        "v" : 2,
                                        "key" : {
                                                "_id" : 1
                                        },
                                        "name" : "_id_",
                                        "ns" : "test.test"
                                }
                        }
                ]
        },
        "ok" : 1
}
> db.runCommand({listCollections: 1,nameOnly:true});
{
        "cursor" : {
                "id" : NumberLong(0),
                "ns" : "test.$cmd.listCollections",
                "firstBatch" : [
                        {
                                "name" : "test_capped",
                                "type" : "collection"
                        },
                        {
                                "name" : "test",
                                "type" : "collection"
                        }
                ]
        },
        "ok" : 1
}
> db.runCommand({listCollections: 1,nameOnly:true,filter:{'options.capped': true}});
{
        "cursor" : {
                "id" : NumberLong(0),
                "ns" : "test.$cmd.listCollections",
                "firstBatch" : [ ]
        },
        "ok" : 1
}
> db.runCommand({listCollections: 1,nameOnly:true,filter:{'options.capped': false}});
{
        "cursor" : {
                "id" : NumberLong(0),
                "ns" : "test.$cmd.listCollections",
                "firstBatch" : [ ]
        },
        "ok" : 1
}
> db.runCommand({listCollections: 1,nameOnly:false,filter:{'options.capped': true}});
{
        "cursor" : {
                "id" : NumberLong(0),
                "ns" : "test.$cmd.listCollections",
                "firstBatch" : [
                        {
                                "name" : "test_capped",
                                "type" : "collection",
                                "options" : {
                                        "capped" : true,
                                        "size" : 10240
                                },
                                "info" : {
                                        "readOnly" : false,
                                        "uuid" : UUID("8de7e5be-fa6e-470e-ac10-63639ed7291a")
                                },
                                "idIndex" : {
                                        "v" : 2,
                                        "key" : {
                                                "_id" : 1
                                        },
                                        "name" : "_id_",
                                        "ns" : "test.test_capped"
                                }
                        }
                ]
        },
        "ok" : 1
}

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.005%) to 74.631% when pulling ae5dee3 on shadow-dot-cat:TBSliver/PERL-897 into 4d21e6f on mongodb:master.

@xdg
Copy link
Contributor

xdg commented Jul 3, 2018

Rebased and merged

@xdg xdg closed this Jul 3, 2018
@TBSliver TBSliver deleted the TBSliver/PERL-897 branch September 14, 2018 14:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants