{"thread":{"id":"52322","subject":"Questions on delta base cache fetching","startedAt":"2019-11-23T19:55:05Z","lastAt":"2019-11-23T19:55:05Z","messageCount":1,"participants":["Matheus Tavares Bernardino"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"386909","messageId":"CAHd-oW4gXSEsO7H0f-85vhWheUQ8CtGw5Jh7QP=h_inBpFTJDA@mail.gmail.com","threadId":"52322","inReplyTo":null,"subject":"Questions on delta base cache fetching","fromName":"Matheus Tavares Bernardino","fromEmail":"matheus.bernardino@usp.br","sentAt":"2019-11-23T19:54:49Z","receivedAt":"2019-11-23T19:55:05Z","isPatch":false,"sender":{"key":"matheus.tavb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12701583?v=4"},"body":"Hi, everyone\n\nA few questions popped into my head regarding unpacking functions that\nfetch from the delta base cache. Their behavior on the cached entries\nsometimes seemed a little counterintuitive for me, so I hoped you\ncould help me better understand.\n\n1. If cache_or_unpack_entry() finds the desired object in cache, it\njust retrieves and returns the entry, not updating its position in the\nLRU list. Shouldn't it do so (possibly by removing and re-inserting\nthe entry)? Or maybe shouldn't the retrieval function itself do the\nupdate?\n\n2. While resolving a delta chain, unpack_entry() checks if the base is\nin cache and removes it if so. At first, this seemed a little odd to\nme, but the entry is re-inserted at phase 3. FWIU, this is done to\nupdate the entry's position in the LRU list, is that right?\n\nHowever, if the function is called to unpack a base object which is\nalready in cache, it will just remove the cache entry and don't\nre-insert it (as it won't go through phase 3). Calling the\ncache_or_unpack_entry() \"wrapper\", thought, will, in this case, return\nthe cache entry without removing it (nor calling unpack_entry()). To\navoid removing recently used entries from the cache, shouldn't\nexternal callers, perhaps, always call the wrapper instead of\nunpack_entry()?\n\nThanks,\nMatheus\n"}]}