#caching
Posts
-
Digging into Gradle's Source 11: The Build Cache and the Configuration Cache — Two Ways to Reuse Work
Where in the source do FROM-CACHE and "Reusing configuration cache." come from? This post covers ResolveMutableCachingStateStep and BuildCacheStep in the execution engine's step chain, what goes into the MD5 cache key, @CacheableTask and the list of reasons not to cache, the local directory cache where the key is the file name and each entry is a tar.gz, the configuration cache that serializes the whole work graph and reloads it even on the very first build, the fingerprint that catches environment variable reads by rewriting bytecode, and the problem report — all checked against the source at a fixed commit and with Docker examples.
-
Digging into Gradle's Source 12: Dependency Resolution — From One implementation Line to Jar Files, and Wrapping Up the Series
What does the single implementation line in build.gradle.kts become in the source? This post follows the DependencyHandler.add() call behind the generated accessor, configurations whose roles are split into declare, resolve and consume, resolution that waits until someone asks for the file list, the loop in which DependencyGraphBuilder grows the graph, the LatestModuleConflictResolver that picks the higher of two versions of the same library and the places where strictly and force change that result, and the two-pass lookup that checks the cache before the repositories, together with --offline and the read-only cache — all checked against the source at a fixed commit and with Docker examples. It then wraps up the 12-part series.
-
Digging into Kafka's Source 7: Log Storage — Segments, Indexes, Retention and Compaction
When does a file like 00000000000000003830.log appear in a partition directory, how is one offset turned into a byte position in that file, who deletes a segment once retention.ms has passed, and how does cleanup.policy=compact sweep away old values of the same key? We follow UnifiedLog, LocalLog, LogSegment, OffsetIndex and LogCleaner in the source, and check with examples the five roll conditions, the sparse index that writes one entry per 4 KB and lives in mmap, the two-step delete through a .deleted rename, the SkimpyOffsetMap built from MD5 hashes of keys, and the recovery point used when a broker comes back from a crash.
-
Digging into MariaDB's Source 5: The Protocol and Command Dispatch — How One Packet Reaches dispatch_command
How the bytes a client sends become packets, how a single first byte decides between COM_QUERY, COM_PING and COM_STMT_EXECUTE, and how the result turns back into packets on the way out — followed through sql/net_serv.cc, do_command() and dispatch_command() in sql_parse.cc, and protocol.cc. We talk to the server directly over bash's /dev/tcp with no client library, and run the query cache to see why it can look up a result before the SQL is even parsed.
-
Digging into MariaDB's Source 7: Preparation — Checking Privileges, Opening Tables, Resolving Names
We follow, in the source, the three things the server does with the parser's LEX before it plans anything. In mysql_execute_command()'s big switch, check_table_access() checks privileges; open_and_lock_tables() takes metadata locks and pulls TABLE_SHARE and TABLE out of their caches; JOIN::prepare() binds column names to Field objects. We watch column-privilege errors 1142 and 1143, Opened_tables and Table_open_cache_hits moving, an ALTER TABLE waiting behind an open transaction with a plain SELECT queued behind it, and the call stack that raises errors 1054 and 1052.
-
Digging into MariaDB's Source 10: InnoDB Part 1 — Pages, the Buffer Pool and B-trees
We go below the handler and read, in the source, the three containers InnoDB keeps data in. The 16KB page with its FIL header, page header, records and page directory; the buffer pool that keeps pages in memory (buf_page_get_gen, the old part of the LRU list, dirty pages and the page cleaner); the clustered-index B-tree that is the table itself (search_leaf, page splits); and the mini-transaction mtr_t that bundles page latches with redo. We open an .ibd file with od and read page headers, look inside the buffer pool through information_schema, grow a table to count B-tree height and splits, and use gdb to watch SELECT and INSERT reach the B-tree.
-
Digging into Spring's Source 27: Caching, Scheduling, Validation, Resilience — Features Built on Top of the Container
@Cacheable, @Scheduled, @Async, @Validated and @Retryable look like separate features, but inside they repeat one pattern. For readers new to Spring, this post checks in the source what each switch annotation registers, which post-processor wraps the bean, and which interceptor intercepts the call, and then wraps up the whole series.