Ivan Prisiazhnyi 's Avatar

Ivan Prisiazhnyi

@johnkoepi

Software Engineer, System Programming, Distributed Systems

198
Followers
116
Following
32
Posts
20.11.2023
Joined
Posts Following

Latest posts by Ivan Prisiazhnyi @johnkoepi

If you recall this project github.com/jeremycole/i... to parse & research InnoDB structures, we now have another one in Rust for MariaDB by surprise github.com/sitano/mdbutil. Unfinished, but works.

04.09.2025 16:31 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

How could it be then you would ask? The answer is simple - redo log is in different directory and the SST script does not account for that. That boring after all that hardcore stuff.

05.08.2025 15:27 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

Then easy-peazy lemon-squizy using logN manual binary-search with my own hands and LLDB I have arrived at SST during LSN was updating. The only thing there that does that is data transfer. It turned out it actually is data transfer. With the only difference - redo log is not t-ed

05.08.2025 15:26 πŸ‘ 0 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

Since I could test system tablespace state I have found out with the help of LLDB that the RSEG LSN changing even before Redo Log initialization (recovery) process on boot. That should mean that it is tampered even before InnoDB. The only serious thing that is there bef is WSREP.

05.08.2025 15:26 πŸ‘ 0 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

So when and how page LSN may be modified? Usually, they are modified during execution IIANW (lol whatsthat) of mini-transactions commit if there were any modifications. Just grep for FIL_PAGE_LSN and mach writes in the code. By using LLDB I now could see non of that points parted

05.08.2025 15:26 πŸ‘ 0 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

What is page LSN though? It is the last record (MTR actually) modification logical sequence number that is there to track page version. It is used during recovery or page load mechanism to verify data integrity. Page checksum and all necessary metadata is also there.

05.08.2025 15:26 πŸ‘ 0 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

in bash this `printf "%d" 0x000144dc` this gives you 83164 u64 that is actually the page's LSN. 1st thing to mention here is that any tablespace page has a header (and a footer). In MDB the page header is 38 bytes (see FIL_PAGE_DATA). Page LSN is at offset 16 (FIL_PAGE_LSN).

05.08.2025 15:25 πŸ‘ 0 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

It is initialized in trx_rseg_array_init() at start during InnoDB engine init in trx_lists_init_at_db_start() after Redo Log has been looked through. With that in mind I was able to peek the changes to page 6 by just looking at 0x18000 with xxd / grep: 6146:00018018: 0001 44dc

05.08.2025 15:25 πŸ‘ 0 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

System tablespace in MariaDB stored in ib_data1 and all 16KB pages are aligned. That means 6th page is at 16KB*6 = 98304 in ib_data1 or at 0x18000 physical offset. System tablespace has at least 8 known lists defined at fsp0types.h one of which is the page 6 rollback segment head

05.08.2025 15:25 πŸ‘ 0 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

Recently saw weird bugs when rollback segments versions ran away from redo log. It turned out its an SST bug :D However, what I did to debug it? I took backtrace of the error message and tracked it to the system tablespace page #6. It turned out ths page is a trx rseg list head.

05.08.2025 15:24 πŸ‘ 0 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

In a full clean (slow) shutdown, the last entry in the log will always be a FILE_CHECKPOINT that bears data LSN for InnoDB tablespaces. It is accepted if CheckpointLsnEntry == EndOfTheLog and the log actually has it at this pos. Obv., you don't need redo log to start if its good.

05.08.2025 15:23 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

If you ever thought what Redo log may look like, here you go: it is chains of micro-edits:

MTR Chain count=4, len=27, lsn=11344769
1: Mtr { space_id: 4, page_no: 3, op: Memset }
2: Mtr { space_id: 4, page_no: 3, op: Write }
3: Mtr { space_id: 4, page_no: 3, op: Memset }
...

05.08.2025 15:23 πŸ‘ 0 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0
Scattered notes on MariaDB redo log internals and file checkpoints. Scattered notes on MariaDB redo log or redo log internals.

If you get bored, I looked through the MariaDB redo log structure to understand what it is made of. Here is the notes sitano.github.io/mariadb/inno... and there is MTR reader in Rust with lots of TODO that can generate fake checkpoints. github.com/sitano/mdbutil

24.07.2025 16:21 πŸ‘ 1 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

Got it. Worth adding this elaboration to the text.

05.07.2025 17:20 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

What is β€œkeying time”? Open/close loop that goes further should be about coordinated omission?

05.07.2025 08:59 πŸ‘ 0 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

I have just ported ngram plugin to MariaDB to allow normal contains() requests with all the new tests only to find out it was done by someone 4 years ago… what a pity. At least I have learned what a rabbit hole this is. Especially for CJK.

15.06.2025 19:24 πŸ‘ 2 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

I just saw a very weird issue with shared dlopened library that gets at some point reloaded by something without applying relocation table. No GDB awatches on its rw-p mem addresses catch it, nor any of dlopen, dlclose, _dl_* or mmap functions. Confused.

03.06.2025 16:00 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

I’m constantly amazed by the historical practice of writing C software in a way that results in source files reaching 20,000 lines of code each.

30.05.2025 07:08 πŸ‘ 2 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

All knows vacuum problems is a myth, ahahahahahah)

21.04.2025 09:13 πŸ‘ 2 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

Just thought what if Nvidia actually can't make anymore hardware improvements to their GPUs by not just putting more cores into the chip and considering they have almost achieved power and thermal limit with 4xxx-5xxx they have no choice but sell software features. But even that will end soon.

19.02.2025 08:49 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
The Generative AI Con It's been just over two years and two months since ChatGPT launched, and in that time we've seen Large Language Models (LLMs) blossom from a novel concept into one of the most craven cons of the 21st ...

Skepticism I share too: The Generative AI Con by Edward Zitron www.wheresyoured.at/longcon/

19.02.2025 08:46 πŸ‘ 3 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

The problem is they are selling it like a next-gen performance improvement while it is not. New cards β€œalmost” even weaker in normal rendering.

11.01.2025 10:50 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

Exactly. Even with a single frame frame gen it feels very bad. Maybe its a game problem but nothing will fix input lag.

11.01.2025 10:49 πŸ‘ 0 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

Frame gen is the biggest BS out there. Like 20 frames to 250.

11.01.2025 10:40 πŸ‘ 1 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0
RTX 50 Series is Slower Than You Think | RTX 40 Series vs RTX 50 Spec for Spec
RTX 50 Series is Slower Than You Think | RTX 40 Series vs RTX 50 Spec for Spec YouTube video by ErockOnTech

Just one of many youtu.be/3C7_40Ifeww?...

11.01.2025 10:39 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

Want to leave it for the future - Nvidia is a modern evil company that is scamming their users (gaming sector) with marketing-lies and high prices at least since the era of mining boom. So disappointing.

11.01.2025 10:38 πŸ‘ 1 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

Big problem with seniority is that by the time and age you (me) get there its time to become an expert in something. Try to cold proof it on the market without a history of related experience.

11.01.2025 10:35 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

Redis Labs OSS clients raid is miraculous nonsense github.com/redis-rs/red....

27.11.2024 09:35 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

It looks like everything is cheaper than datadog :D

10.11.2024 15:00 πŸ‘ 0 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

How to get started in Graphics Programming in 2024: what you need to know + my favorite resources

02.11.2024 11:30 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0