|
Squid Web Cache master
|
#include "squid.h"#include "debug/Messages.h"#include "event.h"#include "fde.h"#include "globals.h"#include "md5.h"#include "SquidConfig.h"#include "StatCounters.h"#include "Store.h"#include "store/Disk.h"#include "store/SwapMetaIn.h"#include "store_digest.h"#include "store_key_md5.h"#include "store_rebuild.h"#include "StoreSearch.h"#include "time/gadgets.h"#include <cerrno>Go to the source code of this file.
Classes | |
| struct | store_rebuild_progress |
Functions | |
| static void | storeCleanup (void *) |
| static void | storeCleanupComplete () |
| handles the completion of zero or more post-rebuild storeCleanup() steps | |
| void | storeRebuildComplete (StoreRebuildData *dc) |
| void | storeRebuildStart (void) |
| void | storeRebuildProgress (const int sd_index_raw, const int total, const int sofar) |
| bool | storeRebuildLoadEntry (int fd, int diskIndex, MemBuf &buf, StoreRebuildData &) |
| loads entry from disk; fills supplied memory buffer on success | |
| bool | storeRebuildParseEntry (MemBuf &buf, StoreEntry &tmpe, cache_key *key, StoreRebuildData &stats, uint64_t expectedSize) |
Variables | |
| static StoreRebuildData | counts |
| static store_rebuild_progress * | RebuildProgress = nullptr |
|
static |
Definition at line 63 of file store_rebuild.cc.
References StoreSearch::currentItem(), DBG_IMPORTANT, debugs, StoreEntry::disk(), Store::Disk::doubleCheck(), EBIT_SET, EBIT_TEST, ENTRY_VALIDATED, eventAdd(), Debug::Extra(), fatalf(), StoreEntry::flags, StoreEntry::hasDisk(), Important, StoreSearch::isDone(), StoreSearch::next(), opt_store_doublecheck, Store::Root(), Store::Controller::search(), storeCleanup(), and storeCleanupComplete().
Referenced by storeCleanup(), and storeRebuildComplete().
|
static |
Definition at line 53 of file store_rebuild.cc.
References assert, store_digest, Store::Controller::store_dirs_rebuilding, and storeDigestNoteStoreReady().
Referenced by storeCleanup(), and storeRebuildComplete().
| void storeRebuildComplete | ( | StoreRebuildData * | dc | ) |
Definition at line 132 of file store_rebuild.cc.
References assert, StoreRebuildData::bad_log_op, StoreRebuildData::badflags, SquidConfig::cacheSwap, StoreRebuildData::cancelcount, StoreRebuildData::clashcount, Config, counts, current_time, debugs, StoreRebuildData::dupcount, eventAdd(), StoreRebuildData::expcount, Debug::Extra(), Important, StoreRebuildData::invalid, Store::DiskConfig::n_configured, StoreRebuildData::objcount, RebuildProgress, safe_free, StoreRebuildData::scancount, StoreRebuildData::started(), StoreRebuildData::startTime, Store::Controller::store_dirs_rebuilding, storeCleanup(), storeCleanupComplete(), tvSubDsec(), StoreRebuildData::updateStartTime(), StoreRebuildData::validations, and StoreRebuildData::zero_object_sz.
Referenced by Store::Disks::init(), Rock::SwapDir::ioCompletedNotification(), and Rock::Rebuild::swanSong().
| bool storeRebuildLoadEntry | ( | int | fd, |
| int | diskIndex, | ||
| MemBuf & | buf, | ||
| StoreRebuildData & | counts | ||
| ) |
Definition at line 265 of file store_rebuild.cc.
References MemBuf::appended(), assert, DBG_IMPORTANT, debugs, StatCounters::disk, FD_READ_METHOD(), MemBuf::hasSpace(), StatCounters::reads, MemBuf::space(), MemBuf::spaceSize(), statCounter, StatCounters::syscalls, and xstrerr().
Referenced by Rock::Rebuild::loadOneSlot(), and Fs::Ufs::RebuildState::rebuildFromDirectory().
| bool storeRebuildParseEntry | ( | MemBuf & | buf, |
| StoreEntry & | e, | ||
| cache_key * | key, | ||
| StoreRebuildData & | counts, | ||
| uint64_t | expectedSize | ||
| ) |
Parses the given Store entry metadata, filling e and key. Optimization: Both e and key parameters may be updated even on failures.
| buf | memory containing serialized Store entry swap metadata (at least) |
| e | caller's temporary StoreEntry object for returning parsed metadata |
| key | caller's temporary Store entry key buffer; usable to set e.key |
| expectedSize | either total entry size (including swap metadata) or 0 |
| true | success; e/key filled with parsed metadata |
| false | failure; e/key ought to be ignored (may be filled/dirty) |
Definition at line 286 of file store_rebuild.cc.
References StoreRebuildData::badflags, CurrentException(), DBG_IMPORTANT, debugs, EBIT_TEST, StoreEntry::flags, Important, hash_link::key, KEY_PRIVATE, StoreEntry::swap_file_sz, and Store::UnpackIndexSwapMeta().
Referenced by Rock::Rebuild::importEntry(), and Fs::Ufs::RebuildState::rebuildFromDirectory().
Definition at line 214 of file store_rebuild.cc.
References SquidConfig::cacheSwap, Config, debugs, double, Important, Store::DiskConfig::n_configured, RebuildProgress, store_rebuild_progress::scanned, squid_curtime, and store_rebuild_progress::total.
Referenced by Rock::Rebuild::loadingSteps(), and Fs::Ufs::RebuildState::rebuildStep().
| void storeRebuildStart | ( | void | ) |
Definition at line 192 of file store_rebuild.cc.
References SquidConfig::cacheSwap, Config, counts, Store::DiskConfig::n_configured, RebuildProgress, and xcalloc().
Referenced by storeInit().
|
static |
Definition at line 30 of file store_rebuild.cc.
Referenced by Fs::Ufs::RebuildState::addIfFresh(), Rock::Rebuild::addSlotToEntry(), Rock::Rebuild::Stats::completed(), Fs::Ufs::RebuildState::evictStaleAndContinue(), Rock::Rebuild::finalizeOrThrow(), Rock::Rebuild::freeSlot(), Rock::Rebuild::importEntry(), Rock::Rebuild::loadingSteps(), Rock::Rebuild::loadOneSlot(), Fs::Ufs::RebuildState::rebuildFromDirectory(), Fs::Ufs::RebuildState::rebuildFromSwapLog(), Rock::Rebuild::start(), storeRebuildComplete(), storeRebuildStart(), Rock::Rebuild::swanSong(), Rock::Rebuild::useNewSlot(), and Rock::Rebuild::validationSteps().
|
static |
Definition at line 43 of file store_rebuild.cc.
Referenced by storeRebuildComplete(), storeRebuildProgress(), and storeRebuildStart().