Skip to content

Instantly share code, notes, and snippets.

View tbg's full-sized avatar

Tobias Grieger tbg

View GitHub Profile
@tbg
tbg / gist:b8db4fd932a445a2b670
Created February 6, 2015 08:57
testrace error: closing closed channel in multiraft.(*state).handleWriteResponse
go test -race -run ".*" "./..." -logtostderr -timeout 1m
? github.com/cockroachdb/cockroach [no test files]
? github.com/cockroachdb/cockroach/build/devbase [no test files]
ok github.com/cockroachdb/cockroach/client 2.737s
ok github.com/cockroachdb/cockroach/gossip 0.630s
? github.com/cockroachdb/cockroach/gossip/simulation [no test files]
ok github.com/cockroachdb/cockroach/kv 27.177s
ok github.com/cockroachdb/cockroach/multiraft 0.653s
ok github.com/cockroachdb/cockroach/multiraft/storagetest 0.038s
ok github.com/cockroachdb/cockroach/proto 0.068s
I0209 08:43:53.214198 7811 raft.go:188] raft: newRaft 101 [peers: [101], term: 5, commit: 10, applied: 10, lastindex: 10, lastterm: 5]
I0209 08:43:53.214249 7811 raft.go:553] raft: 101 no leader at term 5; dropping proposal
I0209 08:43:53.221788 7811 raft.go:440] raft: 101 is starting a new election at term 5
I0209 08:43:53.221816 7811 raft.go:379] raft: 101 became candidate at term 6
I0209 08:43:53.221823 7811 raft.go:423] raft: 101 received vote from 101 at term 6
I0209 08:43:53.221835 7811 raft.go:402] raft: 101 became leader at term 6
I0209 08:43:53.224226 7811 raft.go:366] raft: 101 became follower at term 5
I0209 08:43:53.224244 7811 raft.go:188] raft: newRaft 101 [peers: [101], term: 5, commit: 10, applied: 10, lastindex: 10, lastterm: 5]
I0209 08:43:53.225394 7811 raft.go:366] raft: 101 became follower at term 5
I0209 08:43:53.225413 7811 raft.go:188] raft: newRaft 101 [peers: [101], term: 5, commit: 10, applied: 10, lastindex: 10, lastterm: 5]
level="INFO" time="2015-05-09T20:07:44-04:00" file="start.go" line="110" msg="build Vers: go1.4.2"
level="INFO" time="2015-05-09T20:07:44-04:00" file="start.go" line="111" msg="build Tag: alpha-2207-gf234b6b-dirty"
level="INFO" time="2015-05-09T20:07:44-04:00" file="start.go" line="112" msg="build Time: 2015/05/09 03:48:00"
level="INFO" time="2015-05-09T20:07:44-04:00" file="start.go" line="113" msg="build Deps: /home/tobias/Code/Go/src/github.com/biogo/store:e1f74b3c58befe661feed7fa4cf52436de753128 /home/tobias/Code/Go/src/github.com/cockroachdb/clog:3bff4693fa32f66c52c38eee42b0b50697ee4fc5 /home/tobias/Code/Go/src/github.com/cockroachdb/c-lz4:6e71f140a365017bbe0904710007f8725fd3f809 /home/tobias/Code/Go/src/github.com/cockroachdb/cockroach:f234b6b93eba205be6d1bfa4de72cc5c848928ae /home/tobias/Code/Go/src/github.com/cockroachdb/c-protobuf:9e8dac59ca2a3fc82cd0665ad32b1a36f3df40b8 /home/tobias/Code/Go/src/github.com/cockroachdb/c-rocksdb:e120ce0fb32f86b94188928743270ea11ff016b3 /home/tobias/Code/Go/src/github
impl Request for ::api::PutRequest {
fn create_reply(&self) -> Box<Response> {
Box::new(::api::PutResponse::new()) as Box<Response>
}
}
// impl_request([::api::PutRequest, ::api::PutResponse], [::api::GetRequest, ::api::GetResponse], ...)
@@ -120,6 +125,7 @@ func (t *rpcTransport) Stop(id proto.RaftNodeID) {
// need a feedback mechanism for that. Potentially easiest is to arrange for
// the next call to Send() to fail appropriately.
func (t *rpcTransport) processQueue(raftNodeID proto.RaftNodeID) {
+ trackIndex := uint64(0)
t.mu.Lock()
ch, ok := t.queues[raftNodeID]
t.mu.Unlock()
@@ -162,6 +168,9 @@ func (t *rpcTransport) processQueue(raftNodeID proto.RaftNodeID) {
case <-t.rpcContext.Stopper.ShouldStop():
The handling of the time signal in Cockroach is motivated by the fact that in
Spanner, the target consistency is linearizability, so unrelated transactions must
commit with (database) timestamps whose ordering reflects the order of their
commit timestamps in absolute (i.e. your wrist watch) time. For that to happen,
Spanner basically just "waits" out the clock skew when committing a transaction
(prior to returning to the client). Since they do that, they go to great
lengths to synchronize their clocks and have a good grip on the actual maximal
possible offset.
Cockroach only shoots for serializability (though we do offer linearizable, if
Name Origin Ts Dur Desc File
c674992233552633.12 127.0.0.1:0 10:36:32.233886 1.150545ms node server/node.go:565
c674992233552633.12 127.0.0.1:0 10:36:32.233901 1.135203ms ·executing Put storage/store.go:1254
c674992233552633.12 127.0.0.1:0 10:36:32.233903 206.944µs ··range storage/range.go:513
c674992233552633.12 127.0.0.1:0 10:36:32.233907 3.191µs ···command queue storage/range.go:683
c674992233552633.12 127.0.0.1:0 10:36:32.233915 195.534µs ···raft storage/range.go:725
c674992233552633.12 127.0.0.1:0 10:36:32.234043 63.22µs ····executing storage/range.go:804
c674992233552633.12 127.0.0.1:0 10:36:32.234115 629.877µs ··intent resolution storage/store.go:1280
c674992233552633.12 127.0.0.1:0 10:36:32.234716 2.602µs ···command queue
Name Origin Ts Dur Desc File
c682947558814877.12 127.0.0.1:0 12:49:07.559195 1.302029ms node server/node.go:565
c682947558814877.12 127.0.0.1:0 12:49:07.559210 1.285737ms ·executing Put storage/store.go:1244
c682947558814877.12 127.0.0.1:0 12:49:07.559215 3.614µs ··command queue storage/range.go:677
c682947558814877.12 127.0.0.1:0 12:49:07.559224 214.376µs ··raft storage/range.go:719
c682947558814877.12 127.0.0.1:0 12:49:07.559361 73.052µs ···applying Put storage/range.go:798
c682947558814877.12 127.0.0.1:0 12:49:07.559445 737.64µs ··intent resolution storage/store.go:1341
c682947558814877.12 127.0.0.1:0 12:49:07.560011 0 ···resolving intents [async] storage/store.go:1407
c682947558814877.12 127.0.0.1:0 12:49:07.560198 0 ··error: *proto.WriteIntentError
@tbg
tbg / gist:a9908067dae02160bd76
Created July 9, 2015 22:40
cockroach put acceptance test: trace of a range split txn which gets retried needlessly (because rpc/send abandons the first request)
td06877be roach0.local:8080 17:37:16.838148 899.612522ms node server/node.go:467
td06877be roach0.local:8080 17:37:16.838168 899.587718ms ·executing EndTransaction storage/store.go:1261
td06877be roach0.local:8080 17:37:16.838177 33.422µs ··command queue storage/range.go:683
td06877be roach0.local:8080 17:37:16.838218 899.533937ms ··raft storage/range.go:725
td06877be roach0.local:8080 17:37:16.844148 893.210049ms ···applying EndTransaction storage/range.go:804
td06877be roach0.local:8080 17:37:17.339896 400.998514ms node server/node.go:467
td06877be roach0.local:8080 17:37:17.339919 400.947752ms ·executing EndTransaction storage/store.go:1261
td06877be roach0.local:8080 17:37:17.339930 398.41169ms ··command queue storage/range.go:683
td06877be roach0.local:8080 17:37:17.738349 2.513129ms ··raft storage/range.go:
@tbg
tbg / -
Created August 4, 2015 06:00
go test -tags '' -i ./storage
go test -tags '' -run TestRaftAfterRemoveRange -cpu 1 ./storage -timeout 10s -v --verbosity=5
=== RUN TestRaftAfterRemoveRange
I0804 02:00:52.359526 93842 storage/engine/rocksdb.go:99 opening in-memory rocksdb instance
I0804 02:00:52.364679 93842 storage/engine/rocksdb/rocksdb.go:43 RocksDB version: 3.10.1
I0804 02:00:52.364692 93842 storage/engine/rocksdb/rocksdb.go:43 Git sha rocksdb_build_git_sha:
I0804 02:00:52.364700 93842 storage/engine/rocksdb/rocksdb.go:43 Compile date Jul 26 2015
I0804 02:00:52.364711 93842 storage/engine/rocksdb/rocksdb.go:43 DB SUMMARY