Commit Graph

21 Commits

Author SHA1 Message Date
mpl 443f405962 index: fix data race on BlobSource, make it private.
index.New was starting outOfOrderIndexerLoop in a goroutine. And
outOfOrderIndexerLoop had an if index.BlobSource == nil check, on which
it relied to go on. However, since BlobSource was public and unguarded,
the following sequence was possible:

ix, _ := index.New()
ix.BlobSource = bs

which is racy because the BlobSource assignment may or may not happen
before the check within outOfOrderIndexerLoop.

TestOutOfOrderIndexing was relying on the fact that apparently most
of the time the assignment seems to be happening before the check.

This patch:
-makes BlobSource (now blobSource) private, rendering the race impossible
out of the index package.
-moves the initialization of blobSource, as well as the execution of
outOfOrderIndexerLoop at a unique point, in InitBlobSource (new method).
-makes sure all accesses to blobSource are guarded with the index mutex
(now a RWMutex).

Context: while working on tests for http://camlistore.org/issue/454

Change-Id: I9605f26b41abd62b42880be0620b06ce143761bc
2014-06-27 22:29:29 +02:00
mpl 0cc8f6122d Merge "pkg/index: cleanup, refactor sub pkgs" 2014-04-05 12:45:22 +00:00
mpl 291320d451 pkg/index: cleanup, refactor sub pkgs
http://camlistore.org/issue/263

Change-Id: I319bb097f0ce30b2bd5271b5c3bbff92b8dcc318
2014-04-05 01:22:05 +02:00
Brad Fitzpatrick bf2f09cab3 index: reschedule indexing a claim blob if public key blob isn't yet available
Change-Id: Ie0174bf830eb4790080b2b5e7cdc4ea0af25406f
2014-04-02 13:39:36 -07:00
Brad Fitzpatrick bfc607fee7 index: reindex blobs when dependent blobs arrive out-of-order
Keep track of missing dependencies both in memory and in the index's
underlying sorted.KeyValue. When we see a dependent blob arrive, see
if we can reindex things.

Fixes camlistore.org/issue/102

Change-Id: I3d8cfc463e4b8c9d158be8f9656e772839b093b9
2014-03-15 08:44:09 -07:00
mpl 15bb5f142e pkg/index: use IsDeleted in some of the search methods
1) Done in AppendClaims, PermanodeOfSignerAttrValue,
SearchPermanodesWithAttr, PathsOfSignerTarget,
and PathsLookup.

2) camtypes.Path.DateClaim is now a time.Time, and used
as such in Path search methods.

3) Added kvSignerAttrValue, kvPathBackward, and kvPathForward

4) More Delete tests. We probably want more cases, but that's
a start.

http://camlistore.org/issue/191

Change-Id: I1d42485f2c6d1eea024f70378daacaaad9197768
2013-11-28 16:08:23 +01:00
Brad Fitzpatrick c5037b76e6 Fix thumbnails, broken in cb31dd58d2
Change-Id: I82defd54f53d4f6c1a594185d5e9b7d3a4a92c07
2013-11-20 17:44:10 -08:00
mpl fdaf030bc0 index: add deletedAt method, and cache for deletion status
This method will be used to find out when a permanode or claim
was (un)deleted for the last time.

This change also introduces the keyDeletes index entry which
allows to find the permanodes/claims that a delete claim deletes.

Finally, since some index keys have changed, this CL introduces
a check for an index schema version, to force users to reindex
when needed.

http://camlistore.org/issue/191

Change-Id: I6f8e5d3030a6ddc8b21ff5dc5db311f2ea16f613
2013-11-06 23:34:13 +01:00
Brad Fitzpatrick f696007a14 index: implement EdgesTo
For finding back references in the graph.
2012-11-05 10:29:42 +01:00
Brad Fitzpatrick 17a3faf2df index: export NewMemoryIndex
Change-Id: Iaa6d3268ce0f6c531e37c97799deeb31c11eabdb
2012-11-04 12:18:11 +01:00
Brad Fitzpatrick 3826cc11be index: fix test by excluding the sqlindex package.
it's not a full index, but just an IndexStorage.

Change-Id: I2a3b7c5705c8a01645f2ac3f97f2621b042ef19c
2012-04-13 14:12:04 -07:00
Brad Fitzpatrick 427ef88dc2 mysql indexer: start of tests.
Change-Id: I5df79f57607b5e4fe4f67f79a8e5ba8966e8dec5
2012-03-28 17:15:37 -07:00
Brad Fitzpatrick 2d0e0de553 index: skip dirs stating with _, like _obj
Change-Id: I6c12e2f2740e417fa3858f9872e7ea60843c4877
2012-03-28 16:45:54 -07:00
mpl 95b9622271 Check that all indexer packages have all the required tests
Change-Id: I3c189060bce299235828a9d57a7bb679b05adffd
2012-03-28 10:33:48 +02:00
mpl f9d0ad487e index packages reorganization
Change-Id: Ie91c4bb5ea02a49e59ad093ac972d84b17a046d4
2012-02-26 13:50:14 +01:00
Brad Fitzpatrick af57ae8ae1 don't fail if mongo isn't available
Change-Id: I60754c1f0ec6a942c77ae9618c9a9ee12071ddb4
2012-02-22 01:23:23 -08:00
mpl 5a2c060409 mongo tests now actually fail when no mongodb running
Change-Id: I470c2184c620fa0bba02001ea6877a95cf53d9d6
2012-02-21 15:25:29 +01:00
mpl d40c9dce1d update memindex: use default for db r/w options,
update secring path in test,
-> all tests in index now pass

Change-Id: I8fdd99aad1d0d009cf99c773801a9ae875b56137
2012-02-21 11:51:54 +01:00
mpl a7c4d1f03a time details
Change-Id: Ic4041956e1d7d3b50fea00ab970a68f3c4c2e80d
2012-02-21 11:01:27 +01:00
mpl 50df48d519 first pass with mgo as indexer
fixed indexer so that it builds as a package
added mgo as a third party
fixed mgoindexer
fixed (hackishly) tests so that they pass
I ignored everything memindex for now

Change-Id: I3c03ecfa859cf92b088a759239278b1c0edaf8aa
2012-02-20 14:40:24 +01:00
Brad Fitzpatrick 0714a463c9 Update from r60 to [almost] Go 1.
A lot is still broken, but most stuff at least compiles now.

The directory tree has been rearranged now too.  Go libraries are now
under "pkg".  Fully qualified, they are e.g. "camlistore.org/pkg/jsonsign".

The go tool cannot yet fetch from arbitrary domains, but discussion is
happening now on which mechanism to use to allow that.

For now, put the camlistore root under $GOPATH/src.  Typically $GOPATH
is $HOME, so Camlistore should be at $HOME/src/camlistore.org.

Then you can:

$ go build ./server/camlistored

... etc

The build.pl script is currently disabled.  It'll be resurrected at
some point, but with a very different role (helping create a fake
GOPATH and running the go build command, if things are installed at
the wrong place, and/or running fileembed generators).

Many things are certainly broken.

Many things are disabled.  (MySQL, all indexing, etc).

Many things need to be moved into
camlistore.org/third_party/{code.google.com,github.com} and updated
from their r60 to Go 1 versions, where applicable.

The GoMySQL stuff should be updated to use database/sql and the ziutek
library implementing database/sql/driver.

Help wanted.

Change-Id: If71217dc5c8f0e70dbe46e9504ca5131c6eeacde
2012-02-18 21:53:06 -08:00