#include <jf/jf_config.h>
#include <jf/jf_journal_recovery.h>
#include <jf/jf_utils.h>
#include <jf/jf_crash_simul.h>
#include <jf_file.h>
Go to the source code of this file.
|
Definition at line 39 of file jf_journal_recovery.c. |
|
Analyze the content of a journal file and does some actions related to flags argument; this is a "static" method because it does NOT need a journal object: this method MUST BE INVOKED ON CLOSED journal files to avoid conflicts
References CATCH, jf_journal_t::file_table, fseeko, JF_JOURNAL_ANALYZE_RECOVERY, JF_JOURNAL_ANALYZE_TRACE, jf_journal_file_get_last_pos(), jf_journal_file_tab_get_jfile(), JF_JOURNAL_GLOBAL_FILE_ID, JF_JOURNAL_JOURNAL_FILE_ID, jf_journal_load(), jf_journal_reset(), jf_journal_scan(), jf_journal_trace(), JF_RC_FCLOSE_ERROR, JF_RC_FOPEN_ERROR, JF_RC_INTERNAL_ERROR, JF_RC_OK, JF_TRACE, THROW, and TRUE. Referenced by main(). |
|
|
Return a string describing a control code
References JF_JOURNAL_OP_CODE_APPEND, JF_JOURNAL_OP_CODE_SYNC, JF_JOURNAL_OP_CODE_UPDATE, JF_JOURNAL_OP_DO, JF_JOURNAL_OP_MASK, and jf_word_t. Referenced by jf_journal_fetch_ctrl_code(), and jf_journal_fetch_record(). |
|
Fetch a record from journal file
References byte_t, CATCH, fseeko, ftello, jf_journal_describe_code(), jf_journal_get_stream(), JF_JOURNAL_OP_CODE_APPEND, JF_JOURNAL_OP_CODE_MASK, JF_JOURNAL_OP_CODE_NULL, JF_JOURNAL_OP_CODE_SYNC, JF_JOURNAL_OP_CODE_UPDATE, JF_JOURNAL_OP_DO, JF_JOURNAL_OP_MASK, jf_offset_t, JF_OFFSET_T_FORMAT, JF_RC_EOF, JF_RC_FREAD_ERROR, JF_RC_FSEEK_ERROR, JF_RC_FTELL_ERROR, JF_RC_INTERNAL_ERROR, JF_RC_INVALID_CTRL_CODE, JF_RC_INVALID_STREAM_POSITION, JF_RC_OK, JF_RC_REALLOC_ERROR, JF_TRACE, jf_word_t, JF_WORD_T_FORMAT, jf_journal_t::journal_recs, jf_journal_record_s::offset, jf_journal_record_s::redo_code, jf_journal_record_s::redo_data, jf_journal_record_s::redo_data_alloc, jf_journal_t::size_mask, jf_journal_t::size_mask_shift, THROW, jf_journal_record_s::undo_code, jf_journal_record_s::undo_data, and jf_journal_record_s::undo_data_alloc. Referenced by jf_journal_cold_recovery_patch_record(), jf_journal_scan_redo(), jf_journal_scan_search(), and jf_journal_scan_undo(). |
|
Release dynamic memory allocated for journal record
References jf_journal_record_reset(), jf_journal_record_s::redo_data, and jf_journal_record_s::undo_data. Referenced by jf_journal_cold_recovery_patch_seq(), and jf_journal_scan(). |
|
Reset a journal record
References JF_JOURNAL_OP_CODE_NULL, jf_journal_record_s::redo_code, jf_journal_record_s::redo_data, jf_journal_record_s::redo_data_alloc, jf_journal_record_s::undo_code, jf_journal_record_s::undo_data, and jf_journal_record_s::undo_data_alloc. Referenced by jf_journal_cold_recovery_patch_seq(), jf_journal_record_destroy(), and jf_journal_scan(). |
|
Remove changes from journaled file
References CATCH, jf_journal_t::file_id_mask, jf_journal_t::file_id_mask_shift, jf_journal_t::file_table, fseeko, JF_CRASH_SIMUL, JF_CRASH_SIMUL_F_REMOVE_CHANGES_1, jf_journal_file_get_status(), jf_journal_file_get_stream(), JF_JOURNAL_FILE_ST_OPEN, JF_JOURNAL_FILE_ST_SYNC, jf_journal_file_tab_get_jfile(), jf_journal_file_tab_get_number_of_files(), JF_JOURNAL_JOURNAL_FILE_ID, JF_JOURNAL_OP_CODE_APPEND, JF_JOURNAL_OP_CODE_MASK, JF_JOURNAL_OP_CODE_UPDATE, JF_OFFSET_T_FORMAT, JF_RC_FSEEK_ERROR, JF_RC_FWRITE_ERROR, JF_RC_INTERNAL_ERROR, JF_RC_INVALID_CTRL_CODE, JF_RC_INVALID_STATUS, JF_RC_OK, JF_TRACE, jf_word_t, JF_WORD_T_FORMAT, jf_journal_record_s::offset, jf_journal_t::size_mask, jf_journal_t::size_mask_shift, THROW, jf_journal_record_s::undo_code, and jf_journal_record_s::undo_data. Referenced by jf_journal_cold_recovery_patch_record(), and jf_journal_scan_undo(). |
|
Re-open all journaled file opened at last journal sync time
References CATCH, jf_journal_t::file_table, jf_file_open(), jf_journal_file_get_path(), jf_journal_file_get_status(), jf_journal_file_get_stream(), JF_JOURNAL_FILE_ST_OPEN, jf_journal_file_tab_get_jfile(), jf_journal_file_tab_get_number_of_files(), JF_RC_INTERNAL_ERROR, JF_RC_OK, JF_TRACE, jf_word_t, and THROW. Referenced by jf_journal_scan(). |
|
Scan the content of a journal NOTE: this is a "private" method
References CATCH, fseeko, ftello, JF_JOURNAL_ANALYZE_TRACE, jf_journal_get_stream(), jf_journal_record_destroy(), jf_journal_record_reset(), jf_journal_reopen_files(), jf_journal_scan_redo(), jf_journal_scan_search(), jf_journal_scan_status_t, jf_journal_scan_undo(), jf_journal_trace_record(), jf_offset_t, JF_RC_EOF, JF_RC_FSEEK_ERROR, JF_RC_FTELL_ERROR, JF_RC_INTERNAL_ERROR, JF_RC_OK, JF_SCAN_END, JF_SCAN_REDO, JF_SCAN_SEARCH, JF_SCAN_UNDO, JF_TRACE, jf_word_t, JF_WORD_T_FORMAT, THROW, and TRUE. Referenced by jf_journal_analyze(), and jf_journal_rollback_int(). |
|
Scan the journal content and "redo" changes (commit phase)
References CATCH, jf_journal_apply_changes(), jf_journal_fetch_record(), JF_JOURNAL_OP_CODE_COMMIT, JF_JOURNAL_OP_CODE_ROLLBACK, JF_JOURNAL_OP_MASK, JF_RC_EOF, JF_RC_INTERNAL_ERROR, JF_RC_OK, JF_TRACE, jf_word_t, jf_journal_record_s::redo_code, THROW, and TRUE. Referenced by jf_journal_scan(). |
|
Scan the journal content searching next commit point
References CATCH, jf_journal_t::file_id_mask, jf_journal_t::file_id_mask_shift, fseeko, JF_JOURNAL_ANALYZE_RECOVERY, jf_journal_fetch_record(), jf_journal_get_stream(), JF_JOURNAL_OP_CODE_COMMIT, JF_JOURNAL_OP_CODE_ROLLBACK, JF_JOURNAL_OP_MASK, jf_offset_t, JF_RC_EOF, JF_RC_FSEEK_ERROR, JF_RC_INTERNAL_ERROR, JF_RC_OK, JF_SCAN_REDO, JF_SCAN_UNDO, JF_TRACE, jf_word_t, jf_journal_record_s::redo_code, THROW, and jf_journal_record_s::undo_code. Referenced by jf_journal_scan(). |
|
Scan the journal content and "undo" changes (rollback phase)
References CATCH, FALSE, jf_journal_t::file_id_mask, jf_journal_t::file_id_mask_shift, jf_journal_t::file_table, fseeko, jf_journal_fetch_record(), jf_journal_file_get_status(), jf_journal_file_set_status(), JF_JOURNAL_FILE_ST_SYNC, jf_journal_file_tab_get_jfile(), jf_journal_get_stream(), JF_JOURNAL_GLOBAL_FILE_ID, jf_journal_is_sync(), JF_JOURNAL_OP_CODE_COMMIT, JF_JOURNAL_OP_CODE_ROLLBACK, JF_JOURNAL_OP_MASK, jf_journal_remove_changes(), jf_journal_set_all_sync(), jf_offset_t, JF_RC_EOF, JF_RC_FSEEK_ERROR, JF_RC_INTERNAL_ERROR, JF_RC_OK, JF_TRACE, jf_word_t, JF_WORD_T_FORMAT, THROW, and jf_journal_record_s::undo_code. Referenced by jf_journal_scan(). |
|
Trace the content of a journal record
References CATCH, jf_journal_t::file_id_mask, jf_journal_t::file_id_mask_shift, JF_JOURNAL_ANALYZE_TRACE_HEX_DATA, JF_JOURNAL_ANALYZE_TRACE_TEXT_DATA, JF_JOURNAL_OP_CODE_APPEND, JF_JOURNAL_OP_CODE_MASK, JF_JOURNAL_OP_CODE_SYNC, JF_JOURNAL_OP_CODE_UPDATE, JF_JOURNAL_OP_DO, JF_JOURNAL_OP_MASK, jf_offset_t, JF_OFFSET_T_FORMAT, JF_RC_INTERNAL_ERROR, JF_RC_INVALID_CTRL_CODE, JF_RC_OK, JF_TRACE, jf_trace_hex_data(), jf_trace_text_data(), jf_word_t, JF_WORD_T_FORMAT, jf_journal_record_s::offset, jf_journal_record_s::redo_code, jf_journal_record_s::redo_data, jf_journal_t::size_mask, jf_journal_t::size_mask_shift, THROW, and jf_journal_record_s::undo_data. Referenced by jf_journal_cold_recovery_patch_record(), and jf_journal_scan(). |