Revision bd4040d3

View differences:

src/nebula/Nebula.cc
312 312
            db_backend = new MySqlDB(server, port, user, passwd, db_name);
313 313
        }
314 314

  
315
        solo = server_id == -1 || bootstrap_only;
315
        // ---------------------------------------------------------------------
316
        // Check Database Versions
317
        // ---------------------------------------------------------------------
318
        bool local_bootstrap;
319
        bool shared_bootstrap;
320

  
321
        NebulaLog::log("ONE",Log::INFO,"Checking database version.");
322

  
323
        SystemDB sysdb(db_backend);
324

  
325
        rc = sysdb.check_db_version(is_federation_slave(), local_bootstrap,
326
                shared_bootstrap);
327

  
328
        if( rc == -1 )
329
        {
330
            throw runtime_error("Database version mismatch. Check oned.log.");
331
        }
332

  
333
        // ---------------------------------------------------------------------
334
        // Initialize logging and federation database facilities and SystemDB
335
        // ---------------------------------------------------------------------
336
        solo = server_id == -1;
316 337

  
317
        if ( solo )
338
        if ( (solo && local_bootstrap) || bootstrap_only)
318 339
        {
319 340
            if ( logdb->bootstrap(db_backend) != 0 )
320 341
            {
......
334 355
            db_ptr = logdb;
335 356
        }
336 357

  
337
        // ---------------------------------------------------------------------
338
        // Prepare the SystemDB and check versions
339
        // ---------------------------------------------------------------------
340

  
341
        bool local_bootstrap;
342
        bool shared_bootstrap;
343

  
344
        NebulaLog::log("ONE",Log::INFO,"Checking database version.");
345

  
346 358
        system_db = new SystemDB(logdb);
347 359

  
348
        rc = system_db->check_db_version(is_federation_slave(),
349
                                         local_bootstrap,
350
                                         shared_bootstrap);
351
        if( rc == -1 )
352
        {
353
            throw runtime_error("Database version mismatch. Check oned.log.");
354
        }
355

  
360
        // ---------------------------------------------------------------------
361
        // DB Bootstraping
362
        // ---------------------------------------------------------------------
356 363
        rc = 0;
357 364

  
358 365
        if ( (local_bootstrap || shared_bootstrap) && !solo )

Also available in: Unified diff