couchbase / cbgt Goto Github PK
View Code? Open in Web Editor NEWThe cbgt project provides a generic golang library that manages partitions or data shards across a cluster of servers.
License: Other
The cbgt project provides a generic golang library that manages partitions or data shards across a cluster of servers.
License: Other
https://travis-ci.org/couchbase/cbgt/builds/270901320
--- FAIL: TestManagerRestart (0.01s)
manager_test.go:199: expected load 1 feed, 1 pindex, got: map[], map[]
Especially config CB
You'll want to push tags through gerrit and you'll want to tag the specific SHA1 now that it's under gerrit control.
I think that the RegisterPIndexImplType.New
function that is passed to CBGT:
cbgt.RegisterPIndexImplType(base.IndexTypeSyncGateway, &cbgt.PIndexImplType{
New: <--
is returning nil
, and it's causing CBGT to panic. I think in general, libraries shouldn't panic .. I guess maybe we could provide an OnError
callback function or something instead?
015-12-17T14:48:25.672-08:00 WARNING: Could not find database for bucket name: bucket-1. Unable to instantiate this pindex from disk. -- rest.(*ServerContext).SyncGatewayPIndexFactoryCommon() at server_context.go:185
2015/12/17 14:48:25 manager: loading dataDir... done
2015/12/17 14:48:25 planner: awakes, reason: start
2015/12/17 14:48:25 janitor: awakes, reason: start
2015/12/17 14:48:25 janitor: pindexes to remove: 0
2015/12/17 14:48:25 janitor: pindexes to add: 0
2015/12/17 14:48:25 janitor: feeds to remove: 0
2015/12/17 14:48:25 janitor: feeds to add: 1
2015/12/17 14:48:25 bucket-17732d5ba13e3a6f221f7d00f3e8c6234_2ff2a92097a52ba3
2015/12/17 14:48:25 feed_dcp: start, name: bucket-17732d5ba13e3a6f221f7d00f3e8c6234_2ff2a92097a52ba3
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x48 pc=0x41bdb3e]
goroutine 81 [running]:
github.com/couchbase/cbgt.(*DCPFeed).GetMetaData.func1(0x0, 0x0)
/Users/tleyden/Development/sync_gateway/src/github.com/couchbase/cbgt/feed_dcp.go:477 +0x12e
github.com/couchbase/cbgt.Timer.func1()
/Users/tleyden/Development/sync_gateway/src/github.com/couchbase/cbgt/misc.go:234 +0x25
github.com/rcrowley/go-metrics.(*StandardTimer).Time(0xc8206224e0, 0xc8203ea960)
/Users/tleyden/Development/sync_gateway/src/github.com/rcrowley/go-metrics/timer.go:212 +0x3d
github.com/couchbase/cbgt.Timer(0xc8204083f0, 0x5640b28, 0xc8206224e0, 0x0, 0x0)
/Users/tleyden/Development/sync_gateway/src/github.com/couchbase/cbgt/misc.go:235 +0xa7
github.com/couchbase/cbgt.(*DCPFeed).GetMetaData(0xc820604c30, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/Users/tleyden/Development/sync_gateway/src/github.com/couchbase/cbgt/feed_dcp.go:480 +0x123
github.com/couchbase/go-couchbase/cbdatasource.(*bucketDataSource).getVBucketMetaData(0xc820375680, 0x20, 0x60, 0x486e340, 0x0, 0x0)
/Users/tleyden/Development/sync_gateway/src/github.com/couchbase/go-couchbase/cbdatasource/cbdatasource.go:1235 +0xa2
github.com/couchbase/go-couchbase/cbdatasource.(*bucketDataSource).sendStreamReq(0xc820375680, 0xc8203b0ae0, 0x20, 0x0, 0x0)
/Users/tleyden/Development/sync_gateway/src/github.com/couchbase/go-couchbase/cbdatasource/cbdatasource.go:1275 +0x53
github.com/couchbase/go-couchbase/cbdatasource.(*bucketDataSource).refreshWorker(0xc820375680, 0xc8203b0ae0, 0xc820408180, 0xc8200b8400, 0x40, 0x40, 0x0, 0x0)
/Users/tleyden/Development/sync_gateway/src/github.com/couchbase/go-couchbase/cbdatasource/cbdatasource.go:1011 +0x84e
github.com/couchbase/go-couchbase/cbdatasource.(*bucketDataSource).worker(0xc820375680, 0xc8203ce6c0, 0xf, 0xc82014f860, 0x0)
/Users/tleyden/Development/sync_gateway/src/github.com/couchbase/go-couchbase/cbdatasource/cbdatasource.go:957 +0x11ea
github.com/couchbase/go-couchbase/cbdatasource.(*bucketDataSource).workerStart.func1.1(0x2)
/Users/tleyden/Development/sync_gateway/src/github.com/couchbase/go-couchbase/cbdatasource/cbdatasource.go:681 +0x48
github.com/couchbase/go-couchbase/cbdatasource.ExponentialBackoffLoop(0xc820150e10, 0x23, 0xc820289f38, 0x64, 0x3fc00000, 0x4e20)
/Users/tleyden/Development/sync_gateway/src/github.com/couchbase/go-couchbase/cbdatasource/cbdatasource.go:1518 +0x2b
github.com/couchbase/go-couchbase/cbdatasource.(*bucketDataSource).workerStart.func1(0xc820375680, 0xc8203ce6c0, 0xf, 0xc82014f860, 0x64, 0xc83fc00000, 0x4e20)
/Users/tleyden/Development/sync_gateway/src/github.com/couchbase/go-couchbase/cbdatasource/cbdatasource.go:682 +0x112
created by github.com/couchbase/go-couchbase/cbdatasource.(*bucketDataSource).workerStart
/Users/tleyden/Development/sync_gateway/src/github.com/couchbase/go-couchbase/cbdatasource/cbdatasource.go:685 +0xb7
Noticed this during some experimentation trying to fix couchbase/sync_gateway#1299
add docs/instructions on open-source contributing changes and CLA
http://www.couchbase.com/wiki/display/couchbase/Contributing+Changes
This should be refactored in a way where cbgt does not know about bleve.
https://github.com/couchbase/cbgt/blob/master/rest/static/js/monitor.js#L7
I just stumbled upon https://github.com/couchbase/cbgt/blob/master/misc.go#L32
func init() {
rand.Seed(time.Now().UTC().UnixNano())
}
from the git history it looks like I had added it at some point.
I think it might have been accidentally pushed as a temporary workaround for https://issues.couchbase.com/browse/MB-24237?focusedCommentId=214133, and it should probably get removed per @mschoch's comment about libraries not touching the global random seed.
It's returning text/plain
:
> GET /_cbgt/api/diag HTTP/1.1
> Host: ec2-54-161-145-152.compute-1.amazonaws.com:4985
> User-Agent: curl/7.43.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Thu, 07 Jan 2016 01:36:35 GMT
< Content-Type: text/plain; charset=utf-8
< Transfer-Encoding: chunked
<
{"/api/cfg":{"status":"ok","indexDefs":{"uuid":"20de9a85a0811c01","indexDefs":{"data-bucketab8b6cc0794c1bb43b76e027271aff8b":{"type":"sync_gateway","name":"data-bucketab8b6cc0794c1bb43b76e027271aff8b","uuid":"20de9a85a0811c01","params":"{\"bucket_name\":\"data-bucket\"}","sourceType":"couchbase","sourceName
...
whereas the cfg
endpoint returns application/json
:
> GET /_cbgt/api/cfg HTTP/1.1
> Host: ec2-54-161-145-152.compute-1.amazonaws.com:4985
> User-Agent: curl/7.43.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Cache-Control: no-cache
< Content-Type: application/json
< Date: Thu, 07 Jan 2016 01:37:09 GMT
< Transfer-Encoding: chunked
<
{"status":"ok","indexDefs":{"uu
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.