Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-23131

validate() can return EBUSY on WiredTiger

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.2.4, 3.3.3
    • Component/s: Diagnostics, WiredTiger
    • None
    • Storage Execution
    • ALL
    • Hide
      var replTest = new ReplSetTest({nodes: 1});
      var version = "latest";
      var storageEngine = "wiredTiger";
      var nodes = replTest.startSet({binVersion: version, storageEngine: storageEngine});
      replTest.initiate();
      var db = replTest.getPrimary().getDB("test");
      print(tojson(db.serverStatus()));
      var res = db.adminCommand('listDatabases');
      var invalidColls = [];
      var ebusyColls = [];
      var totalNumEbusy = 0;
      var ebusyCollectionWait = 2000;
      var ebusyCollectionLoops = 30;
      var ebusyAllLoops = 300000;
      res.databases.forEach(dbInfo => {
         var colls = db.getSiblingDB(dbInfo.name).getCollectionInfos();
         colls.forEach(coll => {
            print(dbInfo.name, coll.name);
            var numEbusy = 0;
            var timeStart = new Date().getTime();
            while (true) {
               var val = db.getSiblingDB(dbInfo.name)[coll.name].validate(true);
               var ebusy = val.errors.toString().match('EBUSY');
               if (!ebusy ||
                   ++totalNumEbusy >= ebusyAllLoops ||
                   ++numEbusy >= ebusyCollectionLoops) {
                  if (ebusy) {
                     ebusyColls.push(val.ns);
                  }
                  break;
               }
               sleep(ebusyCollectionWait);
            }
            var timeEnd = new Date().getTime();
            print(tojson(val), '\ntime to validate(msecs)', timeEnd - timeStart);
            if (!val.valid) {
               invalidColls.push(val.ns);
            }
         });
      });
      if (ebusyColls.length) {
         print('EBUSY collections', ebusyColls.join(' '));
      }
      if (invalidColls.length) {
         print('Invalid collections', invalidColls.join(' '));
      }
      replTest.stopSet();
      
      Show
      var replTest = new ReplSetTest({nodes: 1}); var version = "latest" ; var storageEngine = "wiredTiger" ; var nodes = replTest.startSet({binVersion: version, storageEngine: storageEngine}); replTest.initiate(); var db = replTest.getPrimary().getDB( "test" ); print(tojson(db.serverStatus())); var res = db.adminCommand( 'listDatabases' ); var invalidColls = []; var ebusyColls = []; var totalNumEbusy = 0; var ebusyCollectionWait = 2000; var ebusyCollectionLoops = 30; var ebusyAllLoops = 300000; res.databases.forEach(dbInfo => { var colls = db.getSiblingDB(dbInfo.name).getCollectionInfos(); colls.forEach(coll => { print(dbInfo.name, coll.name); var numEbusy = 0; var timeStart = new Date().getTime(); while ( true ) { var val = db.getSiblingDB(dbInfo.name)[coll.name].validate( true ); var ebusy = val.errors.toString().match( 'EBUSY' ); if (!ebusy || ++totalNumEbusy >= ebusyAllLoops || ++numEbusy >= ebusyCollectionLoops) { if (ebusy) { ebusyColls.push(val.ns); } break ; } sleep(ebusyCollectionWait); } var timeEnd = new Date().getTime(); print(tojson(val), '\ntime to validate(msecs)' , timeEnd - timeStart); if (!val.valid) { invalidColls.push(val.ns); } }); }); if (ebusyColls.length) { print( 'EBUSY collections' , ebusyColls.join( ' ' )); } if (invalidColls.length) { print( 'Invalid collections' , invalidColls.join( ' ' )); } replTest.stopSet();
    • TIG 12 (04/01/16)

      When performing a collection validate on all databases/collections (for wiredTiger), some collections will return an EBUSY warning.

      Note - this does not happen in 3.0.10

            Assignee:
            backlog-server-execution [DO NOT USE] Backlog - Storage Execution Team
            Reporter:
            jonathan.abrahams Jonathan Abrahams
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: