~ubuntu-branches/ubuntu/utopic/mongodb/utopic

« back to all changes in this revision

Viewing changes to jstests/sharding/ssv_nochunk.js

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-07-03 09:23:46 UTC
  • mfrom: (1.3.10) (44.1.14 sid)
  • Revision ID: package-import@ubuntu.com-20140703092346-c5bvt46wnzougyly
Tags: 1:2.6.3-0ubuntu1
* New upstream stable release:
  - Dropped patches, included upstream:
    + 0003-All-platforms-but-Windows-find-hash-in-std-tr1.patch
    + 0008-Use-system-libstemmer.patch
    + 0011-Use-a-signed-char-to-store-BSONType-enumerations.patch
    + 0001-SERVER-12064-Atomic-operations-for-gcc-non-Intel-arc.patch
    + 0002-SERVER-12065-Support-ARM-and-AArch64-builds.patch
  - d/p/*: Refreshed/rebased remaining patches.
  - Use system provided libyaml-cpp:
    + d/control: Add libyaml-cpp-dev to BD's.
    + d/rules: Enable --with-system-yaml option.
    + d/p/fix-yaml-detection.patch: Fix detection of libyaml-cpp library.
  - d/mongodb-server.mongodb.upstart: Sync changes from upstream.
  - d/control,mongodb-dev.*: Drop mongodb-dev package; it has no reverse
    dependencies and upstream no longer install header files.
  - d/NEWS: Point users to upstream upgrade documentation for upgrades
    from 2.4 to 2.6.
* Merge from Debian unstable.
* d/control: BD on libv8-3.14-dev to ensure that transitioning to new v8
  versions is a explicit action due to changes in behaviour in >= 3.25
  (LP: #1295723).
* d/mongodb-server.prerm: Dropped debug echo call from maintainer script
  (LP: #1294455).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * Tests setShardVersion, particularly on the case where mongos sends it to a
 
3
 * shard that does not have any chunks.
 
4
 */
 
5
 
 
6
var st = new ShardingTest({ shards: 2, mongos: 2 });
 
7
st.stopBalancer();
 
8
 
 
9
var configDB = st.s.getDB('config');
 
10
configDB.adminCommand({ enableSharding: 'test' });
 
11
configDB.adminCommand({ movePrimary: 'test', to: 'shard0000' });
 
12
configDB.adminCommand({ shardCollection: 'test.user', key: { x: 1 }});
 
13
 
 
14
var testDB = st.s.getDB('test');
 
15
 
 
16
testDB.user.insert({ x: 1 });
 
17
testDB.runCommand({ getLastError: 1 });
 
18
 
 
19
var doc = testDB.user.findOne();
 
20
 
 
21
var testDB2 = st.s1.getDB('test');
 
22
 
 
23
configDB.adminCommand({ moveChunk: 'test.user', find: { x: 0 }, to: 'shard0001' });
 
24
 
 
25
assert.eq(1, testDB.user.find().itcount());
 
26
assert.eq(1, testDB2.user.find().itcount());
 
27
 
 
28
assert.eq(1, testDB.user.find({ x: 1 }).itcount());
 
29
assert.eq(1, testDB2.user.find({ x: 1 }).itcount());
 
30
 
 
31
var configDB2 = st.s1.getDB('config');
 
32
configDB2.adminCommand({ moveChunk: 'test.user', find: { x: 0 }, to: 'shard0000' });
 
33
 
 
34
assert.eq(1, testDB.user.find().itcount());
 
35
assert.eq(1, testDB2.user.find().itcount());
 
36
 
 
37
assert.eq(1, testDB.user.find({ x: 1 }).itcount());
 
38
assert.eq(1, testDB2.user.find({ x: 1 }).itcount());
 
39
 
 
40
st.stop();
 
41