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

« back to all changes in this revision

Viewing changes to jstests/replsets/replset8.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:
17
17
//       documents to be increasing size.
18
18
//       this should result in the updates moving the docs backwards.
19
19
 
20
 
var doccount = 10000;
 
20
var doccount = 5000;
21
21
// Avoid empty extent issues
22
22
mdc.insert( { _id:-1, x:"dummy" } );
23
23
 
24
24
print ("inserting bigstrings");
 
25
var bulk = mdc.initializeUnorderedBulkOp();
25
26
for( i = 0; i < doccount; ++i ) {
26
 
    mdc.insert( { _id:i, x:bigstring } );
 
27
    bulk.insert( { _id:i, x:bigstring } );
27
28
    bigstring += "a";
28
29
}
29
 
md.getLastError();
 
30
assert.writeOK(bulk.execute());
30
31
 
31
32
print ("inserting x");
 
33
bulk = mdc.initializeUnorderedBulkOp();
32
34
for( i = doccount; i < doccount*2; ++i ) {
33
 
    mdc.insert( { _id:i, x:i } );
 
35
    bulk.insert( { _id:i, x:i } );
34
36
}
35
 
md.getLastError();
 
37
assert.writeOK(bulk.execute());
36
38
 
37
39
print ("deleting bigstrings");
 
40
bulk = mdc.initializeUnorderedBulkOp();
38
41
for( i = 0; i < doccount; ++i ) {
39
 
    mdc.remove( { _id:i } );
 
42
    bulk.find({ _id: i }).remove();
40
43
}
41
 
md.getLastError();
 
44
assert.writeOK(bulk.execute());
42
45
 
43
46
// add a secondary
44
47
var slave = rt.add();
50
53
print ("updating documents backwards");
51
54
// Move all documents to the beginning by growing them to sizes that should
52
55
// fit the holes we made in phase 1
 
56
bulk = mdc.initializeUnorderedBulkOp();
53
57
for (i = doccount*2; i > doccount; --i) {
54
58
    mdc.update( { _id:i, x:i }, { _id:i, x:bigstring } );
55
 
    md.getLastError();
56
59
    bigstring = bigstring.slice(0, -1); // remove last char
57
60
}
58
61
print ("finished");