Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release-19.1: storage: RocksDB visibility improvements #36506

Merged
merged 2 commits into from
Apr 4, 2019

Conversation

ajkr
Copy link
Contributor

@ajkr ajkr commented Apr 3, 2019

Backport:

Please see individual PRs for details.

/cc @cockroachdb/release

ajkr added 2 commits April 3, 2019 17:39
Set up a debug page at "/_status/enginestats/<node_id>" that contains
values of all RocksDB ticker stats and histograms. It is also included
in debug zip.

A portion of the debug page (including both tickers and histograms)
looks like this:

![tickershistograms](https://user-images.githubusercontent.com/4780362/55138005-aa88ab00-50ef-11e9-83d6-cc335cc10e6e.png)

The debug zip file contains a JSON file named "debug/nodes/<node_id>/enginestats" with all the tickers/histograms, and looks like this:

```
{
  "stats": [
    {
      "storeId": 1,
      "tickersAndHistograms": {
        "tickers": {
          "rocksdb.blobdb.blob.file.bytes.read": "0",
...
          "rocksdb.write.wal": "296"
        },
        "histograms": {
          "rocksdb.blobdb.blob.file.read.micros": {
            "mean": 0,
            "p50": 0,
            "p95": 0,
            "p99": 0,
            "max": 0,
            "count": "0",
            "sum": "0"
          },
...
          "rocksdb.write.raw.block.micros": {
            "mean": 1.8235294117647058,
            "p50": 0.6071428571428571,
            "p95": 10.749999999999993,
            "p99": 12,
            "max": 12,
            "count": "17",
            "sum": "31"
          }
        }
      }
    }
  ]
}
```

Release note: None
Previously we enabled RocksDB logging only when glog verbosity was set
to three. Additionally, the RocksDB logs were printed at Cockroach's
info severity, regardless of the severity reported by RocksDB.

With this PR, RocksDB warnings, errors, and fatals are logged by
default. Info messages still require verbosity set to three to be sent
to Cockroach's log. Also, we try to set the severity in the Cockroach
log to match the severity reported by RocksDB.

Test Plan: set stall limits low and watch the log messages flow:

```
$ ./cockroach start --logtostderr --insecure
...
W190402 04:40:00.579900 138 storage/engine/rocksdb.go:97  [rocksdb]
[/home/andrew/go/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/column_family.cc:799]
[default] Stalling writes because we have 3 level-0 files rate 3044057
W190402 04:40:00.666972 17 storage/engine/rocksdb.go:97  [rocksdb]
[/home/andrew/go/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/column_family.cc:754]
[default] Stopping writes because we have 4 level-0 files
W190402 04:40:00.985046 482 storage/engine/rocksdb.go:97  [rocksdb]
[/home/andrew/go/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/column_family.cc:799]
[default] Stalling writes because we have 3 level-0 files rate 3044057
W190402 04:40:00.986236 138 storage/engine/rocksdb.go:97  [rocksdb]
[/home/andrew/go/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/column_family.cc:799]
[default] Stalling writes because we have 3 level-0 files rate 1826434
W190402 04:40:01.054917 482 storage/engine/rocksdb.go:97  [rocksdb]
[/home/andrew/go/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/column_family.cc:754]
[default] Stopping writes because we have 4 level-0 files
W190402 04:40:01.422071 17 storage/engine/rocksdb.go:97  [rocksdb]
[/home/andrew/go/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/db/column_family.cc:799]
[default] Stalling writes because we have 3 level-0 files rate 1826434
...
```

Release note: None
@ajkr ajkr requested review from a team April 3, 2019 21:41
@ajkr ajkr requested a review from a team as a code owner April 3, 2019 21:41
@ajkr ajkr requested a review from a team April 3, 2019 21:41
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@tbg
Copy link
Member

tbg commented Apr 4, 2019

LGTM

@ajkr
Copy link
Contributor Author

ajkr commented Apr 4, 2019

bors r=tbg

@ajkr ajkr merged commit a529ef4 into cockroachdb:release-19.1 Apr 4, 2019
@craig
Copy link
Contributor

craig bot commented Apr 4, 2019

Merge conflict

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants