Skip to content

Instantly share code, notes, and snippets.

@tamird
tamird / gist:5f5668e181cafe7d580f
Created December 11, 2015 18:44
docker http redirect
$ curl -I https://docs.docker.com/installation/mac/#from-your-shell
HTTP/1.1 301 Moved Permanently
Content-Length: 0
Connection: keep-alive
Date: Fri, 11 Dec 2015 18:40:59 GMT
Location: http://docs.docker.com/engine/installation/mac/
Server: AmazonS3
X-Cache: Miss from cloudfront
Via: 1.1 1b4ecfde85b6ff2733c4d836183be7ba.cloudfront.net (CloudFront)
X-Amz-Cf-Id: SyKE66gXkYxDGPGiZ20S3hyJmQ_aBV8KLbvdZO2aqO6gAVoB91MmBQ==
valgrind ./main.test
==6001== Memcheck, a memory error detector
==6001== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==6001== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info
==6001== Command: ./main.test
==6001==
==6001== Syscall param set_robust_list(head) points to uninitialised byte(s)
==6001== at 0x569E6F: __pthread_initialize_minimal (nptl-init.c:358)
==6001== by 0x56F5BD: (below main) (in /go/src/golang/src/main.test)
==6001== Address 0x4000b70 is not stack'd, malloc'd or (recently) free'd
⏚ [tamird:~/src/go/src/github.com/cockroachdb/cockroach] revert-revert-multicpu(+1/-0) 2 ± make testrace PKG=./storage TESTFLAGS='-count 300 -parallel 1'
go test -tags '' -race -i ./storage
go test -tags '' -race -run . ./storage -timeout 5m -count 300 -parallel 1
I1104 00:08:43.609204 45133 multiraft/multiraft.go:936 node 1 campaigning because initial confstate is [1]
I1104 00:08:43.610524 45133 storage/replica_command.go:1119 range 1: new leader lease replica {1 1 1} 1970-01-01 00:00:00 +0000 UTC +1.000s
I1104 00:08:43.623744 45133 storage/engine/rocksdb.go:132 closing in-memory rocksdb instance
I1104 00:08:43.713963 45133 multiraft/multiraft.go:936 node 1 campaigning because initial confstate is [1]
I1104 00:08:43.714968 45133 storage/replica_command.go:1119 range 1: new leader lease replica {1 1 1} 1970-01-01 00:00:00 +0000 UTC +1.000s
I1104 00:08:43.716292 45133 storage/engine/rocksdb.go:132 closing in-memory rocksdb instance
I1104 00:08:43.721331 45133 multiraft/multiraft.go:936 node 1 campaign
commit e84576027590e617e639c30e8bdf4a935a86fc6b
Author: Tamir Duberstein <[email protected]>
Date: Tue Nov 3 17:44:04 2015 -0500
return a callback that unregisters
diff --git a/gossip/client.go b/gossip/client.go
index 6ba0ccd..e1945d2 100644
--- a/gossip/client.go
+++ b/gossip/client.go
@tamird
tamird / sql.stats
Created November 2, 2015 02:20
jemalloc stats in cockroachdb
___ Begin jemalloc statistics ___
Version: 0.0.0-0-g0000000000000000000000000000000000000000
Assertions disabled
Run-time option settings:
opt.abort: false
opt.lg_chunk: 21
opt.dss: "secondary"
opt.narenas: 16
opt.lg_dirty_mult: 3 (arenas.lg_dirty_mult: 3)
opt.stats_print: false
$ oracle -pos=roachpb/data.go:#10361 -format=plain callers github.com/cockroachdb/cockroach/
/Users/tamird/src/go/src/github.com/cockroachdb/cockroach/roachpb/data.go:367:17: (*github.com/cockroachdb/cockroach/roachpb.Value).GetBytesChecked is called from these 3 sites:
/Users/tamird/src/go/src/github.com/cockroachdb/cockroach/client/db.go:74:37: static method call from (*github.com/cockroachdb/cockroach/client.KeyValue).PrettyValue
/Users/tamird/src/go/src/github.com/cockroachdb/cockroach/sql/table.go:503:34: static method call from github.com/cockroachdb/cockroach/sql.unmarshalColumnValue
/Users/tamird/src/go/src/github.com/cockroachdb/cockroach/sql/table.go:509:34: static method call from github.com/cockroachdb/cockroach/sql.unmarshalColumnValue
$ oracle -pos=roachpb/data.pb.go:#5930 -format=plain referrers github.com/cockroachdb/cockroach/ | grep -vF cockroachdb/cockroach/roachpb
/Users/tamird/src/go/src/github.com/cockroachdb/cockroach/client/batch.go:131.7-131.11: Bytes: encoding.EncodeUint64(nil, uint64(t.NewValue)),
/Users/tamird/src/go/src/github.com/cockroachdb/cockroach/client/db.go:86.36-86.40: return fmt.Sprintf("%q", kv.Value.Bytes)
/Users/tamird/src/go/src/github.com/cockroachdb/cockroach/client/db.go:109.18-109.22: return kv.Value.Bytes
/Users/tamird/src/go/src/github.com/cockroachdb/cockroach/client/db.go:127.33-127.37: if kv.Value == nil || kv.Value.Bytes == nil {
/Users/tamird/src/go/src/github.com/cockroachdb/cockroach/client/db.go:131.34-131.38: return proto.Unmarshal(kv.Value.Bytes, msg)
/Users/tamird/src/go/src/github.com/cockroachdb/cockroach/config/config.go:113.18-113.22: return kv.Value.Bytes, true
/Users/tamird/src/go/src/github.com/cockroachdb/cockroach/config/config_test.go:52.24-52.28: Value: roachpb.Value{Byt
TXN 1 TXN 2
test=# begin; test=# begin;
BEGIN BEGIN
test=# SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; test=# SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
SET SET
test=# update kv set v = 'b' where k = 'a';
UPDATE 1
                                                |test=# update kv set v = 'a' where k = 'a';

test=# select * from kv; |

@tamird
tamird / TestStatusLocalLogs
Created August 23, 2015 17:15
TestStatusLocalLogs timeout
=== RUN TestStatusLocalStacks
I0823 17:08:58.367808 792 base/context.go:141 setting up TLS from certificates directory: test_certs
I0823 17:08:58.372483 792 base/context.go:103 setting up TLS from certificates directory: test_certs
I0823 17:08:58.375198 792 rpc/clock_offset.go:155 monitoring cluster offset
I0823 17:08:58.375371 792 multiraft/multiraft.go:446 node 100000001 starting
I0823 17:08:58.375517 792 raft/raft.go:406 group 1 100000001 became follower at term 5
I0823 17:08:58.375641 792 raft/raft.go:219 group 1 newRaft 100000001 [peers: [100000001], term: 5, commit: 10, applied: 10, lastindex: 10, lastterm: 5]
I0823 17:08:58.375716 792 raft/raft.go:485 group 1 100000001 is starting a new election at term 5
I0823 17:08:58.375788 792 raft/raft.go:419 group 1 100000001 became candidate at term 6
I0823 17:08:58.375821 792 raft/raft.go:468 group 1 100000001 received vote from 100000001 at term 6
[tamird:~/src/go/src/github.com/cockroachdb/cockroach] go1.5-testing(9)+ 2 ± make PKG=./storage TESTS=TestReplicateAddAndRemove TESTFLAGS='--vmodule=raft=5'
go build -tags '' -ldflags '-X github.com/cockroachdb/cockroach/util.buildTag "alpha-3682-g9553af7" -X github.com/cockroachdb/cockroach/util.buildTime "2015/07/22 23:16:19" -X github.com/cockroachdb/cockroach/util.buildDeps "github.com/biogo/store:e1f74b3c58befe661feed7fa4cf52436de753128 github.com/cockroachdb/c-lz4:6e71f140a365017bbe0904710007f8725fd3f809 github.com/cockroachdb/c-protobuf:0f9ab7b988ca7474cf76b9a961ab03c0552abcb3 github.com/cockroachdb/c-rocksdb:e120ce0fb32f86b94188928743270ea11ff016b3 github.com/cockroachdb/c-snappy:618733f9e5bab8463b9049117a335a7a1bfc9fd5 github.com/cockroachdb/cockroach:9553af7961508128d50b78224d80a1e41e3e6234 github.com/coreos/etcd:3e455ed1049ab4a6152d8df32e58f014abafbc7f github.com/elazarl/go-bindata-assetfs:3dcc96556217539f50599357fb481ac0dc7439b9 github.com/gogo/protobuf:64f27bf06efee53589314a6e5a4af34cdd85adf6 gi