Skip to content

Commit

Permalink
fix t0084
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
  • Loading branch information
whyrusleeping committed Jun 28, 2016
1 parent 3adf12f commit 5483a75
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
10 changes: 1 addition & 9 deletions repo/fsrepo/defaultds.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,8 @@ func openDefaultDatastore(r *FSRepo) (repo.Datastore, error) {
return nil, fmt.Errorf("unable to open leveldb datastore: %v", err)
}

// 4TB of 256kB objects ~=17M objects, splitting that 256-way
// leads to ~66k objects per dir, splitting 256*256-way leads to
// only 256.
//
// The keys seen by the block store have predictable prefixes,
// including "/" from datastore.Key and 2 bytes from multihash. To
// reach a uniform 256-way split, we need approximately 4 bytes of
// prefix.
syncfs := !r.config.Datastore.NoSync
blocksDS, err := flatfs.New(path.Join(r.path, flatfsDirectory), 4, syncfs)
blocksDS, err := flatfs.New(path.Join(r.path, flatfsDirectory), 7, syncfs)
if err != nil {
return nil, fmt.Errorf("unable to open flatfs datastore: %v", err)
}
Expand Down
4 changes: 2 additions & 2 deletions test/sharness/t0084-repo-read-rehash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ test_init_ipfs
H_BLOCK1=$(echo "Block 1" | ipfs add -q)
H_BLOCK2=$(echo "Block 2" | ipfs add -q)

BS_BLOCK1="1220f18e/1220f18e07ebc69997909358f28b9d2c327eb032b0afab6bbc7fd7f399a7b7590be4.data"
BS_BLOCK2="1220dc58/1220dc582e51f1f98b1f2d1c1baaa9f7b11602239ed42fbdf8f52d67e63cc03df12a.data"
BS_BLOCK1="CIQPDD/CIQPDDQH5PDJTF4QSNMPFC45FQZH5MBSWCX2W254P7L7HGNHW5MQXZA.data"
BS_BLOCK2="CIQNYW/CIQNYWBOKHY7TCY7FUOBXKVJ66YRMARDT3KC7PPY6UWWPZR4YA67CKQ.data"


test_expect_success 'blocks are swapped' '
Expand Down

0 comments on commit 5483a75

Please sign in to comment.