PCR cutover today uses RevertRange RPCs that iterate every key in the cluster
(modulo TBI block skipping) to find and tombstone writes newer than time T. This
is O(changed data) in both reads and writes. The idea: attach an MVCC upper time
bound to each SST via a single manifest edit, instantly masking all keys > T from
all iterators. No loading blocks, no writing tombstones, no compaction of those
tombstones — just one manifest write per store.
We want the cost of applying pprof labels to be low enough that we stop conditionally labeling. Today, CockroachDB only applies labels when a profile is actively being collected, checked via an atomic. This means operations that passed the labeling point before profiling started are unlabeled, goroutine dumps are unlabeled, and when labeling IS on, it costs more than it should.
pprof.Do(ctx, Labels("req", strconv.Itoa(id)), func(ctx) { ... }) triggers 4-5 heap allocations:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "compress/gzip" | |
| "fmt" | |
| "os" | |
| "runtime" | |
| "sync" | |
| "sync/atomic" | |
| "time" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| goroutine profile: total 545 | |
| 1 @ 0x100df3960 0x100e31b9c 0x101590bfc 0x100e387c4 | |
| # goroutine: 37 | |
| # created by: 12 | |
| # created at: os/signal.Notify.func1.1, GOROOT/src/os/signal/signal.go:152 +0x101590cf8 | |
| # state: syscall | |
| # waiting: 92 minutes | |
| # 0x100e31b9b os/signal.signal_recv+0x2b GOROOT/src/runtime/sigqueue.go:149 | |
| # 0x101590bfb os/signal.loop+0x1b GOROOT/src/os/signal/signal_unix.go:23 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Copyright 2022 The Cockroach Authors. | |
| // | |
| // Licensed as a CockroachDB Enterprise file under the Cockroach Community | |
| // License (the "License"); you may not use this file except in compliance with | |
| // the License. You may obtain a copy of the License at | |
| // | |
| // https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt | |
| package backupccl_test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var f = SpreadsheetApp.openById('1ZPixvI2lBGPTC-3YmmtbRqEJHU5-A02k9Jfhpw2vw9Q'); | |
| var sheet = f.getSheetByName('Sheet1'); | |
| function doPost(e) { | |
| Logger.log(e); | |
| console.log(e); | |
| parsedData = JSON.parse(e.postData.contents); | |
| var nextFreeRow = sheet.getLastRow() + 1; | |
| sheet.appendRow([parsedData.co2]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <ESP8266WiFi.h> | |
| #include <WiFiClient.h> | |
| #include <ESP8266mDNS.h> | |
| #include <ESP8266HTTPClient.h> | |
| #include <ESP8266WebServer.h> | |
| #include <ArduinoOTA.h> | |
| #include "HTTPSRedirect.h" | |
| #include <SoftwareSerial.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| distsql import, csv reader (i.e. master): 55m | |
| I190326 04:27:02.291051 1 ccl/workloadccl/cliccl/fixtures.go:325 starting import of 9 tables | |
| W190326 04:27:02.293200 1 ccl/workloadccl/fixture.go:541 error retrieving automatic stats cluster setting: pq: unknown setting: "sql.stats.automatic_collection.enabled" | |
| I190326 04:27:12.273697 84 ccl/workloadccl/fixture.go:516 imported warehouse (10s, 1000 rows, 0 index entries, 53 KiB) | |
| I190326 04:27:15.543774 85 ccl/workloadccl/fixture.go:516 imported district (13s, 10000 rows, 0 index entries, 1005 KiB) | |
| I190326 04:27:16.486648 90 ccl/workloadccl/fixture.go:516 imported item (14s, 100000 rows, 0 index entries, 7.8 MiB) | |
| I190326 04:29:01.189457 89 ccl/workloadccl/fixture.go:516 imported new_order (1m59s, 9000000 rows, 0 index entries, 126 MiB) | |
| I190326 04:43:08.922034 88 ccl/workloadccl/fixture.go:516 imported order (16m7s, 30000000 rows, 60000000 index entries, 1.8 GiB) | |
| I190326 04:46:40.282246 87 ccl/workloadccl/fixture.go:516 imported history (19m38s, 30000000 row |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <ESP8266WiFi.h> | |
| #include <WiFiClient.h> | |
| #include <ESP8266mDNS.h> | |
| #include <ESP8266HTTPClient.h> | |
| #include <ESP8266WebServer.h> | |
| #include <ArduinoOTA.h> | |
| #include <SoftwareSerial.h> | |
| byte cmdRead[2] = {0x86, 0x00}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -euxo pipefail | |
| # this script runs backups, creating full backups when run on the configured | |
| # day of the week and incremental backups when run on other days, tracking the | |
| # backups it has created recently to correctly construct the list of path for | |
| # the INCREMENTAL option. | |
| full_day="Sunday" # Must match (including case) the output of `date +%A`. | |
| what="DATABASE mydb" # what to backup. |
NewerOlder