Controller.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
3  *
4  * Squid software is distributed under GPLv2+ license and includes
5  * contributions from numerous individuals and organizations.
6  * Please see the COPYING and CONTRIBUTORS files for details.
7  */
8 
9 /* DEBUG: section 20 Store Controller */
10 
11 #include "squid.h"
12 #include "mem_node.h"
13 #include "MemStore.h"
14 #include "profiler/Profiler.h"
15 #include "SquidConfig.h"
16 #include "SquidMath.h"
17 #include "store/Controller.h"
18 #include "store/Disks.h"
19 #include "store/LocalSearch.h"
20 #include "tools.h"
21 #include "Transients.h"
22 
23 #if HAVE_SYS_WAIT_H
24 #include <sys/wait.h>
25 #endif
26 
27 /*
28  * store_dirs_rebuilding is initialized to _1_ as a hack so that
29  * storeDirWriteCleanLogs() doesn't try to do anything unless _all_
30  * cache_dirs have been read. For example, without this hack, Squid
31  * will try to write clean log files if -kparse fails (becasue it
32  * calls fatal()).
33  */
35 
37  swapDir(new Disks),
38  memStore(NULL),
39  transients(NULL)
40 {
42 }
43 
45 {
46  delete memStore;
47  delete transients;
48  delete swapDir;
49 
50  if (store_table) {
53  store_table = nullptr;
54  }
55 }
56 
57 void
59 {
61  memStore = new MemStore;
62  memStore->init();
63  }
64 
65  swapDir->init();
66 
68  smpAware()) {
69  transients = new Transients;
70  transients->init();
71  }
72 }
73 
74 void
76 {
77  swapDir->create();
78 
79 #if !_SQUID_WINDOWS_
80  pid_t pid;
81  do {
82  PidStatus status;
83  pid = WaitForAnyPid(status, WNOHANG);
84  } while (pid > 0 || (pid < 0 && errno == EINTR));
85 #endif
86 }
87 
88 void
90 {
91  static time_t last_warn_time = 0;
92 
93  PROF_start(storeMaintainSwapSpace);
94  swapDir->maintain();
95 
96  /* this should be emitted by the oversize dir, not globally */
97 
98  if (Root().currentSize() > Store::Root().maxSize()) {
99  if (squid_curtime - last_warn_time > 10) {
100  debugs(20, DBG_CRITICAL, "WARNING: Disk space over limit: "
101  << Store::Root().currentSize() / 1024.0 << " KB > "
102  << (Store::Root().maxSize() >> 10) << " KB");
103  last_warn_time = squid_curtime;
104  }
105  }
106 
107  PROF_stop(storeMaintainSwapSpace);
108 }
109 
110 void
112 {
113  if (memStore)
114  memStore->getStats(stats);
115  else {
116  // move this code to a non-shared memory cache class when we have it
117  stats.mem.shared = false;
118  stats.mem.capacity = Config.memMaxSize;
119  stats.mem.size = mem_node::StoreMemSize();
120  stats.mem.count = hot_obj_count;
121  }
122 
123  swapDir->getStats(stats);
124 
125  // low-level info not specific to memory or disk cache
128 }
129 
130 void
132 {
133  storeAppendPrintf(&output, "Store Directory Statistics:\n");
134  storeAppendPrintf(&output, "Store Entries : %lu\n",
135  (unsigned long int)StoreEntry::inUseCount());
136  storeAppendPrintf(&output, "Maximum Swap Size : %" PRIu64 " KB\n",
137  maxSize() >> 10);
138  storeAppendPrintf(&output, "Current Store Swap Size: %.2f KB\n",
139  currentSize() / 1024.0);
140  storeAppendPrintf(&output, "Current Capacity : %.2f%% used, %.2f%% free\n",
141  Math::doublePercent(currentSize(), maxSize()),
142  Math::doublePercent((maxSize() - currentSize()), maxSize()));
143 
144  if (memStore)
145  memStore->stat(output);
146 
147  /* now the swapDir */
148  swapDir->stat(output);
149 }
150 
151 /* if needed, this could be taught to cache the result */
152 uint64_t
154 {
155  /* TODO: include memory cache ? */
156  return swapDir->maxSize();
157 }
158 
159 uint64_t
161 {
162  /* TODO: include memory cache ? */
163  return swapDir->minSize();
164 }
165 
166 uint64_t
168 {
169  /* TODO: include memory cache ? */
170  return swapDir->currentSize();
171 }
172 
173 uint64_t
175 {
176  /* TODO: include memory cache ? */
177  return swapDir->currentCount();
178 }
179 
180 int64_t
182 {
183  /* TODO: include memory cache ? */
184  return swapDir->maxObjectSize();
185 }
186 
187 void
189 {
190  swapDir->updateLimits();
191 
192  store_swap_high = (long) (((float) maxSize() *
193  (float) Config.Swap.highWaterMark) / (float) 100);
194  store_swap_low = (long) (((float) maxSize() *
195  (float) Config.Swap.lowWaterMark) / (float) 100);
197 
198  // TODO: move this into a memory cache class when we have one
199  const int64_t memMax = static_cast<int64_t>(min(Config.Store.maxInMemObjSize, Config.memMaxSize));
200  const int64_t disksMax = swapDir ? swapDir->maxObjectSize() : 0;
201  store_maxobjsize = std::max(disksMax, memMax);
202 }
203 
204 StoreSearch *
206 {
207  // this is the only kind of search we currently support
208  return NewLocalSearch();
209 }
210 
211 void
213 {
214  if (memStore)
215  memStore->sync();
216  swapDir->sync();
217 }
218 
219 /*
220  * handle callbacks all avaliable fs'es
221  */
222 int
224 {
225  /* This will likely double count. Thats ok. */
226  PROF_start(storeDirCallback);
227 
228  /* mem cache callbacks ? */
229  int result = swapDir->callback();
230 
231  PROF_stop(storeDirCallback);
232 
233  return result;
234 }
235 
236 void
238 {
239  // special entries do not belong to any specific Store, but are IN_MEMORY
240  if (EBIT_TEST(e.flags, ENTRY_SPECIAL))
241  return;
242 
243  /* Notify the fs that we're referencing this object again */
244 
245  if (e.swap_dirn > -1)
246  swapDir->reference(e);
247 
248  // Notify the memory cache that we're referencing this object again
249  if (memStore && e.mem_status == IN_MEMORY)
250  memStore->reference(e);
251 
252  // TODO: move this code to a non-shared memory cache class when we have it
253  if (e.mem_obj) {
254  if (mem_policy->Referenced)
256  }
257 }
258 
259 bool
261 {
262  // special entries do not belong to any specific Store, but are IN_MEMORY
263  if (EBIT_TEST(e.flags, ENTRY_SPECIAL))
264  return true;
265 
266  bool keepInStoreTable = false; // keep only if somebody needs it there
267 
268  /* Notify the fs that we're not referencing this object any more */
269 
270  if (e.swap_filen > -1)
271  keepInStoreTable = swapDir->dereference(e) || keepInStoreTable;
272 
273  // Notify the memory cache that we're not referencing this object any more
274  if (memStore && e.mem_status == IN_MEMORY)
275  keepInStoreTable = memStore->dereference(e) || keepInStoreTable;
276 
277  // TODO: move this code to a non-shared memory cache class when we have it
278  if (e.mem_obj) {
281  // non-shared memory cache relies on store_table
282  if (!memStore)
283  keepInStoreTable = wantsLocalMemory || keepInStoreTable;
284  }
285 
286  return keepInStoreTable;
287 }
288 
289 StoreEntry *
291 {
292  if (StoreEntry *e = find(key)) {
293  // this is not very precise: some get()s are not initiated by clients
294  e->touch();
295  referenceBusy(*e);
296  return e;
297  }
298  return NULL;
299 }
300 
303 StoreEntry *
305 {
306  debugs(20, 3, storeKeyText(key));
307 
308  if (StoreEntry *e = static_cast<StoreEntry*>(hash_lookup(store_table, key))) {
309  // TODO: ignore and maybe handleIdleEntry() unlocked intransit entries
310  // because their backing store slot may be gone already.
311  debugs(20, 3, HERE << "got in-transit entry: " << *e);
312  return e;
313  }
314 
315  // Must search transients before caches because we must sync those we find.
316  if (transients) {
317  if (StoreEntry *e = transients->get(key)) {
318  debugs(20, 3, "got shared in-transit entry: " << *e);
319  bool inSync = false;
320  const bool found = anchorCollapsed(*e, inSync);
321  if (!found || inSync)
322  return e;
323  assert(!e->locked()); // ensure release will destroyStoreEntry()
324  e->release(); // do not let others into the same trap
325  return NULL;
326  }
327  }
328 
329  if (memStore) {
330  if (StoreEntry *e = memStore->get(key)) {
331  debugs(20, 3, HERE << "got mem-cached entry: " << *e);
332  return e;
333  }
334  }
335 
336  if (swapDir) {
337  if (StoreEntry *e = swapDir->get(key)) {
338  debugs(20, 3, "got disk-cached entry: " << *e);
339  return e;
340  }
341  }
342 
343  debugs(20, 4, "cannot locate " << storeKeyText(key));
344  return nullptr;
345 }
346 
347 int64_t
349 {
350  return swapDir ? swapDir->accumulateMore(entry) : 0;
351  // The memory cache should not influence for-swapout accumulation decision.
352 }
353 
354 void
356 {
357  if (transients && e.mem_obj && e.mem_obj->xitTable.index >= 0)
358  transients->markForUnlink(e);
359  if (memStore && e.mem_obj && e.mem_obj->memCache.index >= 0)
360  memStore->markForUnlink(e);
361  if (swapDir && e.swap_filen >= 0)
362  swapDir->markForUnlink(e);
363 }
364 
365 void
367 {
368  memoryUnlink(e);
369  if (swapDir && e.swap_filen >= 0)
370  swapDir->unlink(e);
371 }
372 
373 // move this into [non-shared] memory cache class when we have one
375 bool
377 {
378  if (!e.memoryCachable())
379  return false;
380 
381  // does the current and expected size obey memory caching limits?
382  assert(e.mem_obj);
383  const int64_t loadedSize = e.mem_obj->endOffset();
384  const int64_t expectedSize = e.mem_obj->expectedReplySize(); // may be < 0
385  const int64_t ramSize = max(loadedSize, expectedSize);
386  const int64_t ramLimit = min(
387  static_cast<int64_t>(Config.memMaxSize),
388  static_cast<int64_t>(Config.Store.maxInMemObjSize));
389  return ramSize <= ramLimit;
390 }
391 
392 void
393 Store::Controller::memoryOut(StoreEntry &e, const bool preserveSwappable)
394 {
395  bool keepInLocalMemory = false;
396  if (memStore)
397  memStore->write(e); // leave keepInLocalMemory false
398  else
399  keepInLocalMemory = keepForLocalMemoryCache(e);
400 
401  debugs(20, 7, HERE << "keepInLocalMemory: " << keepInLocalMemory);
402 
403  if (!keepInLocalMemory)
404  e.trimMemory(preserveSwappable);
405 }
406 
407 void
409 {
410  if (memStore)
411  memStore->unlink(e);
412  else // TODO: move into [non-shared] memory cache class when we have one
413  e.destroyMemObject();
414 }
415 
416 void
418 {
419  if (memStore)
420  memStore->disconnect(e);
421  // else nothing to do for non-shared memory cache
422 }
423 
424 void
426 {
427  if (transients) {
428  assert(e.mem_obj);
429  if (e.mem_obj->xitTable.index >= 0)
430  transients->abandon(e);
431  }
432 }
433 
434 void
436 {
437  if (transients) {
438  assert(e.mem_obj);
439  if (e.mem_obj->xitTable.index >= 0)
440  transients->completeWriting(e);
441  }
442 }
443 
444 int
446 {
447  return (transients && e.mem_obj && e.mem_obj->xitTable.index >= 0) ?
448  transients->readers(e) : 0;
449 }
450 
451 void
453 {
454  if (transients)
455  transients->disconnect(mem_obj);
456 }
457 
458 void
460 {
461  bool keepInLocalMemory = false;
462 
463  if (EBIT_TEST(e.flags, ENTRY_SPECIAL)) {
464  // Icons (and cache digests?) should stay in store_table until we
465  // have a dedicated storage for them (that would not purge them).
466  // They are not managed [well] by any specific Store handled below.
467  keepInLocalMemory = true;
468  } else if (memStore) {
469  // leave keepInLocalMemory false; memStore maintains its own cache
470  } else {
471  keepInLocalMemory = keepForLocalMemoryCache(e) && // in good shape and
472  // the local memory cache is not overflowing
474  }
475 
476  // An idle, unlocked entry that only belongs to a SwapDir which controls
477  // its own index, should not stay in the global store_table.
478  if (!dereferenceIdle(e, keepInLocalMemory)) {
479  debugs(20, 5, HERE << "destroying unlocked entry: " << &e << ' ' << e);
480  destroyStoreEntry(static_cast<hash_link*>(&e));
481  return;
482  }
483 
484  debugs(20, 5, HERE << "keepInLocalMemory: " << keepInLocalMemory);
485 
486  // TODO: move this into [non-shared] memory cache class when we have one
487  if (keepInLocalMemory) {
489  e.mem_obj->unlinkRequest();
490  } else {
491  e.purgeMem(); // may free e
492  }
493 }
494 
495 void
497 {
498  /* update the old entry object */
499  Must(old);
500  HttpReply *oldReply = const_cast<HttpReply*>(old->getReply());
501  Must(oldReply);
502 
503  const bool modified = oldReply->updateOnNotModified(newer.getReply());
504  if (!old->timestampsSet() && !modified)
505  return;
506 
507  /* update stored image of the old entry */
508 
509  if (memStore && old->mem_status == IN_MEMORY && !EBIT_TEST(old->flags, ENTRY_SPECIAL))
510  memStore->updateHeaders(old);
511 
512  if (old->swap_dirn > -1)
513  swapDir->updateHeaders(old);
514 }
515 
516 void
518  const HttpRequestMethod &reqMethod)
519 {
520  const KeyScope keyScope = reqFlags.refresh ? ksRevalidation : ksDefault;
521  e->makePublic(keyScope); // this is needed for both local and SMP collapsing
522  if (transients)
523  transients->startWriting(e, reqFlags, reqMethod);
524  debugs(20, 3, "may " << (transients && e->mem_obj->xitTable.index >= 0 ?
525  "SMP-" : "locally-") << "collapse " << *e);
526 }
527 
528 void
530 {
531  assert(transients);
532 
533  StoreEntry *collapsed = transients->findCollapsed(xitIndex);
534  if (!collapsed) { // the entry is no longer locally active, ignore update
535  debugs(20, 7, "not SMP-syncing not-transient " << xitIndex);
536  return;
537  }
538  assert(collapsed->mem_obj);
539  assert(collapsed->mem_obj->smpCollapsed);
540 
541  debugs(20, 7, "syncing " << *collapsed);
542 
543  bool abandoned = transients->abandoned(*collapsed);
544  bool found = false;
545  bool inSync = false;
546  if (memStore && collapsed->mem_obj->memCache.io == MemObject::ioDone) {
547  found = true;
548  inSync = true;
549  debugs(20, 7, "fully mem-loaded " << *collapsed);
550  } else if (memStore && collapsed->mem_obj->memCache.index >= 0) {
551  found = true;
552  inSync = memStore->updateCollapsed(*collapsed);
553  } else if (swapDir && collapsed->swap_filen >= 0) {
554  found = true;
555  inSync = swapDir->updateCollapsed(*collapsed);
556  } else {
557  found = anchorCollapsed(*collapsed, inSync);
558  }
559 
560  if (abandoned && collapsed->store_status == STORE_PENDING) {
561  debugs(20, 3, "aborting abandoned but STORE_PENDING " << *collapsed);
562  collapsed->abort();
563  return;
564  }
565 
566  if (inSync) {
567  debugs(20, 5, "synced " << *collapsed);
568  collapsed->invokeHandlers();
569  } else if (found) { // unrecoverable problem syncing this entry
570  debugs(20, 3, "aborting unsyncable " << *collapsed);
571  collapsed->abort();
572  } else { // the entry is still not in one of the caches
573  debugs(20, 7, "waiting " << *collapsed);
574  }
575 }
576 
580 bool
582 {
583  // this method is designed to work with collapsed transients only
584  assert(collapsed.mem_obj);
585  assert(collapsed.mem_obj->xitTable.index >= 0);
586  assert(collapsed.mem_obj->smpCollapsed);
587 
588  debugs(20, 7, "anchoring " << collapsed);
589 
590  bool found = false;
591  if (memStore)
592  found = memStore->anchorCollapsed(collapsed, inSync);
593  if (!found && swapDir)
594  found = swapDir->anchorCollapsed(collapsed, inSync);
595 
596  if (found) {
597  if (inSync)
598  debugs(20, 7, "anchored " << collapsed);
599  else
600  debugs(20, 5, "failed to anchor " << collapsed);
601  } else {
602  debugs(20, 7, "skipping not yet cached " << collapsed);
603  }
604 
605  return found;
606 }
607 
608 bool
610 {
611  return memStore || (swapDir && swapDir->smpAware());
612 }
613 
614 namespace Store {
616 }
617 
620 {
621  assert(TheRoot);
622  return *TheRoot;
623 }
624 
625 void
627 {
628  TheRoot = root ? root : new Controller;
629 }
630 
631 void
633 {
634  TheRoot = nullptr;
635 }
636 
sdirno swap_dirn
Definition: Store.h:179
void Init(Controller *root=nullptr)
initialize the storage module; a custom root is used by unit tests only
Definition: Controller.cc:626
StoreSearch * search()
Definition: Controller.cc:205
static int store_dirs_rebuilding
the number of cache_dirs being rebuilt; TODO: move to Disks::Rebuilding
Definition: Controller.h:90
hash_table * store_table
virtual StoreEntry * get(const cache_key *) override
Retrieve a store entry from the store (blocking)
Definition: Controller.cc:290
int PidStatus
Definition: tools.h:94
#define assert(EX)
Definition: assert.h:17
RemovalPolicyNode repl
Definition: MemObject.h:167
size_t maxInMemObjSize
Definition: SquidConfig.h:264
virtual void init() override
Definition: Transients.cc:43
void touch()
update last reference timestamp and related Store metadata
Definition: store.cc:455
SQUIDCEXTERN void hashFreeMemory(hash_table *)
Definition: hash.cc:272
size_t store_pages_max
void unlinkRequest()
Definition: MemObject.h:54
double size
bytes currently in use
Definition: StoreStats.h:20
bool timestampsSet()
Definition: store.cc:1525
int collapsed_forwarding
Definition: SquidConfig.h:323
unsigned char cache_key
Store key.
Definition: forward.h:29
pid_t WaitForAnyPid(PidStatus &status, int flags)
Definition: tools.h:111
void makePublic(const KeyScope keyScope=ksDefault)
Definition: store.cc:142
virtual void sync() override
prepare for shutdown
Definition: Controller.cc:212
int64_t endOffset() const
Definition: MemObject.cc:232
RemovalPolicy * mem_policy
Definition: MemObject.cc:45
int64_t store_maxobjsize
static size_t inUseCount()
Definition: store.cc:173
virtual void init() override
Definition: MemStore.cc:180
const char * storeKeyText(const cache_key *key)
double mem_object_count
number of MemObject objects in existence
Definition: StoreStats.h:53
YesNoNone memShared
whether the memory cache is shared among workers
Definition: SquidConfig.h:79
Io io
current I/O state
Definition: MemObject.h:149
class Ping::pingStats_ stats
static size_t inUseCount()
Definition: MemObject.cc:48
struct SquidConfig::@110 Store
sfileno swap_filen
unique ID inside a cache_dir for swapped out entries; -1 for others
Definition: Store.h:177
bool dereferenceIdle(StoreEntry &, bool wantsLocalMemory)
dereference() an idle entry and return true if the entry should be deleted
Definition: Controller.cc:260
#define DBG_CRITICAL
Definition: Debug.h:44
static size_t StoreMemSize()
Definition: mem_node.cc:61
void referenceBusy(StoreEntry &e)
update reference counters of the recently touched entry
Definition: Controller.cc:237
Controller & Root()
safely access controller singleton
Definition: Controller.cc:619
High-level store statistics used by mgr:info action. Used inside PODs!
Definition: StoreStats.h:13
void transientsDisconnect(MemObject &)
disassociates the entry from the intransit table
Definition: Controller.cc:452
int lowWaterMark
Definition: SquidConfig.h:76
double store_entry_count
number of StoreEntry objects in existence
Definition: StoreStats.h:52
double count
number of cached objects
Definition: StoreStats.h:21
void destroyMemObject()
Definition: store.cc:370
StoreEntry * find(const cache_key *key)
Definition: Controller.cc:304
A const & max(A const &lhs, A const &rhs)
MemCache memCache
current [shared] memory caching state for the entry
Definition: MemObject.h:151
XitTable xitTable
current [shared] memory caching state for the entry
Definition: MemObject.h:138
int32_t index
entry position inside the memory cache
Definition: MemObject.h:146
bool IamWorkerProcess()
whether the current process handles HTTP transactions and such
Definition: stub_tools.cc:49
time_t squid_curtime
Definition: stub_time.cc:17
void updateLimits()
slowly calculate (and cache) hi/lo watermarks and similar limits
Definition: Controller.cc:188
int32_t index
entry position inside the in-transit table
Definition: MemObject.h:135
virtual bool smpAware() const override
Definition: Controller.cc:609
void purgeMem()
Definition: store.cc:434
double capacity
the size limit
Definition: StoreStats.h:22
virtual uint64_t maxSize() const override
Definition: Controller.cc:153
int transientReaders(const StoreEntry &) const
number of the transient entry readers some time ago
Definition: Controller.cc:445
double doublePercent(const double, const double)
Definition: SquidMath.cc:25
void invokeHandlers()
Mem mem
all cache_dirs stats
Definition: StoreStats.h:49
static RefCount< Controller > TheRoot
Definition: Controller.cc:615
virtual void maintain() override
perform regular periodic maintenance; TODO: move to UFSSwapDir::Maintain
Definition: Controller.cc:89
virtual ~Controller() override
Definition: Controller.cc:44
#define debugs(SECTION, LEVEL, CONTENT)
Definition: Debug.h:123
bool updateOnNotModified(HttpReply const *other)
Definition: HttpReply.cc:246
void abort()
Definition: store.cc:1134
int store_swap_high
virtual HttpReply const * getReply() const
Definition: store.cc:1742
void handleIdleEntry(StoreEntry &)
called when the entry is no longer needed by any transaction
Definition: Controller.cc:459
mem_status_t mem_status
Definition: Store.h:181
bool smpCollapsed
whether this entry gets data from another worker
Definition: MemObject.h:153
void(* Referenced)(RemovalPolicy *policy, const StoreEntry *entry, RemovalPolicyNode *node)
Definition: RemovalPolicy.h:48
SQUIDCEXTERN hash_link * hash_lookup(hash_table *, const void *)
Definition: hash.cc:147
static size_t InUseCount()
Definition: mem_node.cc:55
summary view of all disk caches (cache_dirs) combined
Definition: Disks.h:18
void transientsAbandon(StoreEntry &)
calls Root().transients->abandon() if transients are tracked
Definition: Controller.cc:425
uint16_t flags
Definition: Store.h:173
SQUIDCEXTERN void hashFreeItems(hash_table *, HASHFREE *)
Definition: hash.cc:256
virtual void getStats(StoreInfoStats &stats) const override
collect statistics
Definition: Controller.cc:111
int64_t accumulateMore(StoreEntry &) const
Definition: Controller.cc:348
signed_int32_t sfileno
Definition: forward.h:22
MemObject * mem_obj
Definition: Store.h:162
virtual int callback() override
called once every main loop iteration; TODO: Move to UFS code.
Definition: Controller.cc:223
::Transients Transients
Definition: forward.h:48
bool anchorCollapsed(StoreEntry &, bool &inSync)
Definition: Controller.cc:581
bool UsingSmp()
Whether there should be more than one worker process running.
Definition: tools.cc:658
std::ostream & HERE(std::ostream &s)
Definition: Debug.h:147
struct SquidConfig::@112 onoff
bool shared
whether memory cache is shared among workers
Definition: StoreStats.h:42
#define Must(cond)
Definition: TextException.h:89
static pid_t pid
Definition: IcmpSquid.cc:35
void allowCollapsing(StoreEntry *, const RequestFlags &, const HttpRequestMethod &)
makes the entry available for collapsing future requests
Definition: Controller.cc:517
void memoryDisconnect(StoreEntry &)
disassociates the entry from the memory cache, preserving cached data
Definition: Controller.cc:417
int highWaterMark
Definition: SquidConfig.h:75
#define PRIu64
Definition: types.h:120
void transientsCompleteWriting(StoreEntry &)
marks the entry completed for collapsed requests
Definition: Controller.cc:435
store_status_t store_status
Definition: Store.h:185
virtual void create() override
create system resources needed for this store to operate in the future
Definition: Controller.cc:75
#define PROF_start(probename)
Definition: Profiler.h:62
void FreeMemory()
undo Init()
Definition: Controller.cc:632
void(* Dereferenced)(RemovalPolicy *policy, const StoreEntry *entry, RemovalPolicyNode *node)
Definition: RemovalPolicy.h:49
bool memoryCachable()
checkCachable() and can be cached in memory
Definition: store.cc:1410
KeyScope
Definition: store_key_md5.h:18
virtual void unlink(StoreEntry &) override
remove the entry from the store
Definition: Controller.cc:366
size_t memMaxSize
Definition: SquidConfig.h:81
void const cache_key * key
virtual uint64_t minSize() const override
the minimum size the store will shrink to via normal housekeeping
Definition: Controller.cc:160
int hot_obj_count
virtual void init() override
Definition: Controller.cc:58
#define PROF_stop(probename)
Definition: Profiler.h:63
void memoryOut(StoreEntry &, const bool preserveSwappable)
called to get rid of no longer needed entry data in RAM, if any
Definition: Controller.cc:393
virtual uint64_t currentCount() const override
the total number of objects stored right now
Definition: Controller.cc:174
int store_swap_low
void updateOnNotModified(StoreEntry *old, const StoreEntry &newer)
update old entry metadata and HTTP headers using a newer entry
Definition: Controller.cc:496
bool keepForLocalMemoryCache(StoreEntry &e) const
whether e should be kept in local RAM for possible future caching
Definition: Controller.cc:376
FREE destroyStoreEntry
void storeAppendPrintf(StoreEntry *e, const char *fmt,...)
Definition: store.cc:904
struct SquidConfig::@96 Swap
#define EBIT_TEST(flag, bit)
Definition: defines.h:107
virtual void stat(StoreEntry &) const override
Definition: Controller.cc:131
virtual uint64_t currentSize() const override
current size
Definition: Controller.cc:167
class SquidConfig Config
Definition: SquidConfig.cc:12
#define NULL
Definition: types.h:166
virtual int64_t maxObjectSize() const override
the maximum size of a storable object; -1 if unlimited
Definition: Controller.cc:181
int64_t expectedReplySize() const
Definition: MemObject.cc:256
void syncCollapsed(const sfileno)
Update local intransit entry after changes made by appending worker.
Definition: Controller.cc:529
A const & min(A const &lhs, A const &rhs)
virtual void trimMemory(const bool preserveSwappable)
Definition: store.cc:1938
void memoryUnlink(StoreEntry &)
removes the entry from the memory cache
Definition: Controller.cc:408
virtual void markForUnlink(StoreEntry &) override
expect an unlink() call after the entry becomes idle
Definition: Controller.cc:355
StoreSearch * NewLocalSearch()
Definition: LocalSearch.cc:48
void setMemStatus(mem_status_t)
Definition: store.cc:1630

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors