• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/BerkeleyDB-21/db/env/

Lines Matching defs:?f

39  *	Perform recovery.  If max_lsn is non-NULL, then we are trying
41 * LSN of max_lsn, so we need to roll back sufficiently far for that
90 * If we need to, update the env handle timestamp.
92 if (update && REP_ON(env)) {
104 if ((ret = __log_cursor(env, &logc)) != 0)
108 * If the user is specifying recovery to a particular point in time
112 if (max_lsn != NULL) {
113 if ((ret = __log_backup(env, logc, max_lsn, &lowlsn,
116 } else if (dbenv->tx_timestamp != 0) {
117 if ((ret = __log_earliest(env, logc, &low, &lowlsn)) != 0)
119 if ((int32_t)dbenv->tx_timestamp < low) {
123 if ((p = strchr(t1, '\n')) != NULL)
130 if ((p = strchr(t2, '\n')) != NULL)
145 * We need to open files beginning with the earlier of the
147 * recovery timestamp, if specified. We need to be before the
161 * 0,0). At the end of this pass, we know all transactions for
162 * which we've seen begins and we have the "current" set of files
168 * 1. If doing catastrophic recovery, we read to the
169 * beginning of the log
170 * 2. If we are doing normal reovery, then we have to roll
172 * 3. If we are recovering to a point in time, then we have
176 * 4. If we are recovering back to a particular LSN, then
190 * ckp_lsn -- lsn of the last checkpoint or the first in the log.
193 * lowlsn -- the lsn we are rolling back to, if we are recovering
203 * the last one. We assume that each of the three phases takes the
204 * same amount of time (a false assumption) and then use the %-age
205 * of the amount of log traversed to figure out how much of the
208 * If we can't find any log records, we're kind of done.
214 if ((ret = __logc_get(logc, &last_lsn, &data, DB_LAST)) != 0) {
215 if (ret == DB_NOTFOUND)
227 if (txnid != 0)
233 * we're recovering to an LSN. If we are, we need to proceed since
237 if (ret == DB_NOTFOUND)
239 else if (ret != 0)
248 * If this is a catastrophic recovery, or if no checkpoint exists
251 * Otherwise, it is the minimum of (1) the LSN in the last checkpoint
257 * even if this is not a catastrophic recovery.
259 if ((ret = __logc_get(logc, &ckp_lsn, &data, DB_FIRST)) != 0) {
260 if (ret == DB_NOTFOUND)
269 if (!LF_ISSET(DB_RECOVER_FATAL)) {
270 if ((ret = __txn_getckp(env, &ckp_lsn)) == 0 &&
273 if ((ret = __txn_ckp_read(env,
287 * If LSN (2) exists, use it if it's before LSN (1).
288 * (If LSN (1) doesn't exist, first_lsn is the
289 * beginning of the log, so will "win" this check.)
293 * __log_earliest, and is the checkpoint LSN of the
296 * instead for the LSN of the *latest* checkpoint before
297 * the timestamp of interest, but I'm not sure that this
301 * is that we pick *some* checkpoint after the beginning of
304 if ((dbenv->tx_timestamp != 0 || max_lsn != NULL) &&
311 /* Get the record at first_lsn if we don't have it already. */
312 if (!have_rec &&
320 if (dbenv->db_feedback != NULL) {
321 if (last_lsn.file == first_lsn.file)
329 if (nfiles < 0.001)
336 if (hi_txn != 0) do {
341 if (txnid != 0)
349 if (ret == DB_NOTFOUND) {
350 if (LOG_COMPARE(&lsn, &last_lsn) != 0)
357 if (ret != 0 ||
362 if ((ret = __db_txnlist_init(env, ip,
370 if ((ret = __env_openfiles(env, logc,
374 /* If there were no transactions, then we can bail out early. */
375 if (hi_txn == 0 && max_lsn == NULL)
384 if (FLD_ISSET(dbenv->verbose, DB_VERB_RECOVERY))
395 if (dbenv->db_feedback != NULL) {
404 if (ret != 0) {
405 if (ret != DB_TXN_CKP)
411 if (ret == DB_NOTFOUND) {
412 if (LOG_COMPARE(&lsn, &first_lsn) > 0)
417 if (ret != 0)
421 * Pass #3. If we are recovering to a timestamp or to an LSN,
432 if (max_lsn != NULL || dbenv->tx_timestamp != 0)
438 if (dbenv->db_feedback != NULL) {
447 if (ret != 0) {
448 if (ret != DB_TXN_CKP)
454 * If we are recovering to a timestamp or an LSN,
456 * forward beyond the soon-to-be end of log.
458 if (LOG_COMPARE(&lsn, &stop_lsn) >= 0)
462 if (ret == DB_NOTFOUND)
464 if (ret != 0)
467 if (max_lsn == NULL)
470 if (dbenv->tx_timestamp != 0) {
472 if (logc != NULL) {
473 if ((ret = __logc_close(logc)) != 0)
482 if ((ret = __memp_sync_int(env, NULL, 0,
486 if ((ret = __log_vtruncate(env,
494 if (!IS_REP_CLIENT(env) && (ret = __txn_checkpoint(env, 0, 0,
497 * If there was no space for the checkpoint we can
502 if (max_lsn == NULL && ret == ENOSPC)
508 if (region->stat.st_nrestores == 0) {
510 if ((ret = __dbreg_close_files(env, 0)) != 0)
513 if ((ret = __dbreg_mark_restored(env)) != 0)
518 if (max_lsn != NULL) {
519 if (!IS_ZERO_LSN(((DB_TXNHEAD *)txninfo)->ckplsn))
521 else if ((ret =
526 if (logc != NULL && (ret = __logc_close(logc)) != 0)
529 if ((ret = __log_vtruncate(env,
539 if ((ret = __log_cursor(env, &logc)) != 0)
541 if ((ret =
543 if (ret == DB_NOTFOUND)
549 if ((ret = __txn_getckp(env, &first_lsn)) == 0 &&
552 if ((ret = __txn_ckp_read(env,
563 if ((ret = __logc_get(logc, &first_lsn, &data, DB_SET)) != 0)
565 if ((ret = __env_openfiles(env, logc,
568 } else if (region->stat.st_nrestores == 0) {
570 * If there are no prepared transactions that need resolution,
573 if ((ret = __txn_reset(env)) != 0)
576 if ((ret = __txn_recycle_id(env)) != 0)
581 * We must be sure to zero the tail of the log. Otherwise a partial
582 * record may be at the end of the log and it may never be fully
585 if (max_lsn == NULL && dbenv->tx_timestamp == 0) {
587 if (logc != NULL && (ret = __logc_close(logc)) != 0)
592 if ((ret =
595 if ((ret = __log_vtruncate(env,
600 if (FLD_ISSET(dbenv->verbose, DB_VERB_RECOVERY)) {
613 if (0) {
619 err: if (logc != NULL && (t_ret = __logc_close(logc)) != 0 && ret == 0)
622 if (txninfo != NULL)
635 * Figure out how many logfiles we have processed. If we are moving
636 * forward (is_forward != 0), then we're computing current - low. If
638 * the number of bytes per logfile.
646 double nf;
649 * There are three cases in each direction. If you are in the
651 * offsets. If you are in different files, then either your offsets
653 * number of files -- we need to handle both of these.
655 if (is_forward) {
656 if (current->file == low->file)
657 nf = (double)(current->offset - low->offset) / max;
658 else if (current->offset < low->offset)
659 nf = (double)((current->file - low->file) - 1) +
663 nf = (double)(current->file - low->file) +
666 if (current->file == high->file)
667 nf = (double)(high->offset - current->offset) / max;
668 else if (current->offset > high->offset)
669 nf = (double)((high->file - current->file) - 1) +
673 nf = (double)(high->file - current->file) +
676 return (nf);
707 if (cmp != CKPLSN_CMP && cmp != LASTCKP_CMP)
710 if ((ret = __txn_getckp(env, &lsn)) != 0)
717 if ((ret = __txn_ckp_read(
720 if (cmp == CKPLSN_CMP) {
731 * we want the LSN of this checkpoint strictly less
737 if (lcmp) {
744 * If there are no more checkpoints behind us, we're
747 if (IS_ZERO_LSN(lsn)) {
755 if (ckp_args != NULL)
758 * For CKPLSN_CMP if we walked back through all the checkpoints,
762 err: if (IS_ZERO_LSN(*start_lsn) && cmp == CKPLSN_CMP &&
772 * earliest recovery time is the time stamp of the first checkpoint record
797 if (rectype != DB___txn_ckp)
799 if ((ret =
806 if (cmp >= 0)
816 * Perform the pass of recovery that opens files. This is used
821 * See the comments in db_apprec for a detailed description of the
824 * If we are not doing feedback processing (i.e., we are doing txn_recover
861 if (in_recovery && dbenv->db_feedback != NULL) {
872 if (ret != 0 && ret != DB_TXN_CKP) {
878 if ((ret = __logc_get(logc, &lsn, data, DB_NEXT)) != 0) {
879 if (ret == DB_NOTFOUND) {
880 if (last_lsn != NULL &&
920 if ((ret = __env_init_rec_47(env)) != 0)
929 * differences between 4.5 and 4.6. The name of the rep_gen in
957 if ((ret = __db_add_recovery_int(env, &env->recover_dtab,
960 if ((ret = __db_add_recovery_int(env, &env->recover_dtab,
963 if ((ret = __db_add_recovery_int(env, &env->recover_dtab,
966 if ((ret = __db_add_recovery_int(env, &env->recover_dtab,
969 if ((ret = __db_add_recovery_int(env, &env->recover_dtab,
972 if ((ret = __db_add_recovery_int(env, &env->recover_dtab,
975 if ((ret = __db_add_recovery_int(env, &env->recover_dtab,
978 if ((ret = __db_add_recovery_int(env, &env->recover_dtab,
991 if ((ret = __db_add_recovery_int(env, &env->recover_dtab,
997 if ((ret = __db_add_recovery_int(env, &env->recover_dtab,
1010 if ((ret = __db_add_recovery_int(env, &env->recover_dtab,
1023 if ((ret = __bam_init_recover(env, &env->recover_dtab)) != 0)
1025 if ((ret = __crdel_init_recover(env, &env->recover_dtab)) != 0)
1027 if ((ret = __db_init_recover(env, &env->recover_dtab)) != 0)
1029 if ((ret = __dbreg_init_recover(env, &env->recover_dtab)) != 0)
1031 if ((ret = __fop_init_recover(env, &env->recover_dtab)) != 0)
1033 if ((ret = __ham_init_recover(env, &env->recover_dtab)) != 0)
1035 if ((ret = __qam_init_recover(env, &env->recover_dtab)) != 0)
1037 if ((ret = __txn_init_recover(env, &env->recover_dtab)) != 0)