예제 #1
0
파일: oplog.cpp 프로젝트: anagri/mongo
 void logOp(const char *opstr, const char *ns, const BSONObj& obj, BSONObj *patt, bool *b) {
     if ( replSettings.master ) {
         _logOp(opstr, ns, "local.oplog.$main", obj, patt, b, OpTime::now());
         char cl[ 256 ];
         nsToDatabase( ns, cl );
     }
     NamespaceDetailsTransient &t = NamespaceDetailsTransient::get_w( ns );
     if ( t.cllEnabled() ) {
         try {
             _logOp(opstr, ns, t.cllNS().c_str(), obj, patt, b, OpTime::now());
         } catch ( const DBException & ) {
             t.cllInvalidate();
         }
     }
 }    
예제 #2
0
파일: oplog.cpp 프로젝트: chmanie/mongo
    /*@ @param opstr:
          c userCreateNS
          i insert
          n no-op / keepalive
          d delete / remove
          u update
    */
    void logOp(OperationContext* txn,
               const char* opstr,
               const char* ns,
               const BSONObj& obj,
               BSONObj* patt,
               bool* b,
               bool fromMigrate) {
        try {
            if ( getGlobalReplicationCoordinator()->isReplEnabled() ) {
                _logOp(txn, opstr, ns, 0, obj, patt, b, fromMigrate);
            }

            logOpForSharding(txn, opstr, ns, obj, patt, fromMigrate);
            logOpForDbHash(ns);
            getGlobalAuthorizationManager()->logOp(opstr, ns, obj, patt, b);

            if ( strstr( ns, ".system.js" ) ) {
                Scope::storedFuncMod(); // this is terrible
            }
        }
        catch (const DBException& ex) {
            severe() << "Fatal DBException in logOp(): " << ex.toString();
            std::terminate();
        }
        catch (const std::exception& ex) {
            severe() << "Fatal std::exception in logOp(): " << ex.what();
            std::terminate();
        }
        catch (...) {
            severe() << "Fatal error in logOp()";
            std::terminate();
        }
    }
예제 #3
0
    /*@ @param opstr:
          c userCreateNS
          i insert
          n no-op / keepalive
          d delete / remove
          u update
    */
    void logOp(const char *opstr, const char *ns, const BSONObj& obj, BSONObj *patt, bool *b) {
        if ( replSettings.master ) {
            _logOp(opstr, ns, 0, obj, patt, b);
        }

        logOpForSharding( opstr , ns , obj , patt );
    }
예제 #4
0
파일: oplog.cpp 프로젝트: bukamanush/mongo
    /*@ @param opstr:
          c userCreateNS
          i insert
          n no-op / keepalive
          d delete / remove
          u update
    */
    void logOp(const char* opstr,
               const char* ns,
               const BSONObj& obj,
               BSONObj* patt,
               bool* b,
               bool fromMigrate,
               const BSONObj* fullObj) {
        if ( replSettings.master ) {
            _logOp(opstr, ns, 0, obj, patt, b, fromMigrate);
        }

        logOpForSharding(opstr, ns, obj, patt, fullObj, fromMigrate);
    }
예제 #5
0
파일: oplog.cpp 프로젝트: TylerBrock/mongo
    /*@ @param opstr:
          c userCreateNS
          i insert
          n no-op / keepalive
          d delete / remove
          u update
    */
    void logOp(OperationContext* txn,
               const char* opstr,
               const char* ns,
               const BSONObj& obj,
               BSONObj* patt,
               bool* b,
               bool fromMigrate) {
        try {
            // TODO SERVER-15192 remove this once all listeners are rollback-safe.
            class RollbackPreventer : public RecoveryUnit::Change {
                virtual void commit() {}
                virtual void rollback() {
                    severe() << "Rollback of logOp not currently allowed (SERVER-15192)";
                    fassertFailed(18805);
                }
            };
            txn->recoveryUnit()->registerChange(new RollbackPreventer());

            if ( getGlobalReplicationCoordinator()->isReplEnabled() ) {
                _logOp(txn, opstr, ns, 0, obj, patt, b, fromMigrate);
            }

            logOpForSharding(txn, opstr, ns, obj, patt, fromMigrate);
            logOpForDbHash(ns);
            getGlobalAuthorizationManager()->logOp(opstr, ns, obj, patt, b);

            if ( strstr( ns, ".system.js" ) ) {
                Scope::storedFuncMod(); // this is terrible
            }
        }
        catch (const DBException& ex) {
            severe() << "Fatal DBException in logOp(): " << ex.toString();
            std::terminate();
        }
        catch (const std::exception& ex) {
            severe() << "Fatal std::exception in logOp(): " << ex.what();
            std::terminate();
        }
        catch (...) {
            severe() << "Fatal error in logOp()";
            std::terminate();
        }
    }
예제 #6
0
    /*@ @param opstr:
          c userCreateNS
          i insert
          n no-op / keepalive
          d delete / remove
          u update
    */
    void logOp(OperationContext* txn,
               const char* opstr,
               const char* ns,
               const BSONObj& obj,
               BSONObj* patt,
               bool* b,
               bool fromMigrate) {
        if ( replSettings.master ) {
            _logOp(txn, opstr, ns, 0, obj, patt, b, fromMigrate);
        }

        logOpForSharding(txn, opstr, ns, obj, patt, fromMigrate);
        logOpForDbHash(ns);
        getGlobalAuthorizationManager()->logOp(opstr, ns, obj, patt, b);

        if ( strstr( ns, ".system.js" ) ) {
            Scope::storedFuncMod(); // this is terrible
        }

    }
예제 #7
0
파일: oplog.cpp 프로젝트: anagri/mongo
 void logKeepalive() { 
     BSONObj obj;
     _logOp("n", "", "local.oplog.$main", obj, 0, 0, OpTime::now());
 }
예제 #8
0
 void logOpComment(const BSONObj& obj) {
     _logOp("n", "", 0, obj, 0, 0);
 }
예제 #9
0
 void logKeepalive() {
     _logOp("n", "", 0, BSONObj(), 0, 0);
 }
예제 #10
0
파일: oplog.cpp 프로젝트: chmanie/mongo
 void logOpComment(OperationContext* txn, const BSONObj& obj) {
     _logOp(txn, "n", "", 0, obj, 0, 0, false);
 }
예제 #11
0
파일: oplog.cpp 프로젝트: chmanie/mongo
 void logKeepalive(OperationContext* txn) {
     _logOp(txn, "n", "", 0, BSONObj(), 0, 0, false);
 }
예제 #12
0
 void logOpComment(const BSONObj& obj) {
     OperationContextImpl txn;
     _logOp(&txn, "n", "", 0, obj, 0, 0, false);
 }
예제 #13
0
 void logKeepalive() {
     OperationContextImpl txn;
     _logOp(&txn, "n", "", 0, BSONObj(), 0, 0, false);
 }