So we have a problem which is triggered in part by the race detector, but which is actually deeper, but also possibly rare enough to be politely ignored. The real underlying issue is that sometimes when we have multiple tests running in CI, multiple instances of the CLI test end up using the same postgres database backing for some of their DAX stuff. We have workarounds for this in some places, but not others. But the *observed symptom* of this is that it can cause a trivial race detector issue where we have one call to `(*Resource).Lock()` and another call to `(*Resource).IsLocked()` which aren't synchronized in any way, so if the race detector spots this, it complains. We can suppress that very easily by synchronizing these. That does not solve the other possibly-weird problems, so this may not actually address the issue, but I think it might reduce the rate of sporadic failures significantly, which would give us some time to think about solving the deeper problem. The underlying design issue is that we're reusing the database name in postgres for testing. This lets us have bounded growth (one database) while leaving the database contents up after a failed test (so we can examine them), then truncating the database during startup if it already exists. Which works fine if *only one thing runs at once*, which would be true on a laptop, but in CI, it's sometimes not true. A real fix for that is complex and requires some rethinking of how we approach the test stuff, as we don't want unbounded growth, but we also don't want two copies of the test running at once to see each other, and ensuring cleanup after a test failure is surprisingly hard. |
||
|---|---|---|
| .. | ||
| computer | ||
| controller | ||
| http | ||
| migrations | ||
| models | ||
| queryer | ||
| server | ||
| snapshotter | ||
| storage | ||
| test | ||
| writelogger | ||
| address.go | ||
| address_test.go | ||
| controller.go | ||
| dax.go | ||
| directive.go | ||
| directive_version_test.go | ||
| errors.go | ||
| Makefile | ||
| migrations.go | ||
| node.go | ||
| README.md | ||
| role.go | ||
| schema.go | ||
| service_manager.go | ||
| snapshot.go | ||
| table.go | ||
| table_test.go | ||
| time.go | ||
| transaction.go | ||
| versioned_partition.go | ||
| versioned_shard.go | ||
| workerjob.go | ||
| workerjob_test.go | ||
DAX
DAX encapsulates anything which covers all of the services which make up the "disaggregation of storage and compute" project. Initially, this will include integration tests which pull in things like Metadata Services (MDS), including the Controller, as well as FeatureBase and IDK-based ingesters.
Setting up the tests
The DAX test currently requires docker images for: featurebase and datagen.
If at any point you run into problems with go mod failing to reference a private
repo, make sure that you have gitlab.com/featurebasedb in your GOPRIVATE
environment variable.
Note that during the docker image build step, go mod vendor is run, which
creates a vendor directory in the root directory, and copies that to docker
during the build stage. Just be aware of this; you may want to remove that
vendor directory after you're done building docker images.
Possible Configuruation
The following were relevent when the dax code was in a separate repository. These may no longer be relevant.
I needed to but this in my ~/.profile file:
export GOPRIVATE=github.com/featurebasedb,gitlab.com/featurebasedb
And this in my ~/.gitconfig
[url "ssh://git@github.com/"]
insteadOf = https://github.com/
[url "ssh://git@gitlab.com/"]
insteadOf = https://gitlab.com/
Then make docker ran successfully.
Build the FeatureBase docker image
- Check out the dax branch of the featurebase repository.
- Run
make docker-image-featurebaseto build the docker image - You should now have an image in docker named
dax/featurebasewith the taglatest.
Build the Datagen docker image
cd <featurebase_repo_root>/idk- Run
make docker-image-datagento build the docker image - You should now have an image in docker named
dax/datagenwith the taglatest.
Running the tests
- Check out the dax branch of the featurebase repository.
- Change into the
daxdirectory:cd dax - Run
make test-integration.