sapling/eden/mononoke/tests/integration/test-multiplexed-chaosblob.t
Thomas Orozco b3bebee0b4 mononoke: include DB config in multiplexed blobstore configuration
Summary:
This updates our multiplexed blobstore configuration to carry its own DB
config. The upshot of this change is that we can move the blobstore sync queue
(a fairly unruly table) to its own DB.

Another nice side effect of this is that it cleans up a bunch of other code, by
finally decoupling the blobstore config from the DB config. For examples,
places that need to instantiate a blobstore can now to do even without a DB
config (such as wireproto logging).

Obviously, this cannot land until we update the configs to include this. I'll
do so in Configerator prior to landing the diff.

Reviewed By: HarveyHunt

Differential Revision: D19973905

fbshipit-source-id: 79e4ff92cdb989aab4532decd3fe4fd6c55e2bb2
2020-02-24 11:54:45 -08:00

49 lines
1.3 KiB
Perl

# Copyright (c) Facebook, Inc. and its affiliates.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License found in the LICENSE file in the root
# directory of this source tree.
$ . "${TEST_FIXTURES}/library.sh"
setup configuration
$ MULTIPLEXED=2 default_setup_blobimport "blob_files"
hg repo
o C [draft;rev=2;26805aba1e60]
|
o B [draft;rev=1;112478962961]
|
o A [draft;rev=0;426bada5c675]
$
blobimporting
Base case, check the stores have expected counts
$ ls blobstore/0/blobs/ | wc -l
30
$ ls blobstore/1/blobs/ | wc -l
30
$ ls blobstore/2/blobs/ | wc -l
30
Check that healer queue has all items
$ sqlite3 "$TESTTMP/blobstore_sync_queue/sqlite_dbs" "select count(*) FROM blobstore_sync_queue";
90
Erase the sqllites and blobstore_sync_queue
$ rm -rf "$TESTTMP/blobstore_sync_queue/sqlite_dbs" "$TESTTMP/blobstore/"*/blobs/*
blobimport them into Mononoke storage again, but with failures on one side
$ blobimport repo-hg/.hg repo --blobstore-write-chaos-rate=1
Check the stores have expected counts
$ ls blobstore/0/blobs/ | wc -l
0
$ ls blobstore/1/blobs/ | wc -l
30
$ ls blobstore/2/blobs/ | wc -l
30
Check that healer queue has successful items
$ sqlite3 "$TESTTMP/blobstore_sync_queue/sqlite_dbs" "select count(*) FROM blobstore_sync_queue";
60