Closed JanKrivanek closed 5 months ago
Does it support the full list of all records (not the summary)? Useful for diffing. Even just the types of records would be valuable so that you can diff two .txt files and see what is the first record where they start to differ.
Would be nice to support formats before 18 too. We can compute records lengths like ReadRecords does, see my draft in #741
@KirillOsenkov - All comments sounds sound and easily accomodable - I'll work on this in a few days.
As for:
Does it support the full list of all records (not the summary)? Useful for diffing. Even just the types of records would be valuable > so that you can diff two .txt files and see what is the first record where they start to differ.
The ungrouped list is the default mode. I added the optional groupping as that's what I needed for my other investigation. Though - do you expect the sizes to differ a bit? Would you want to have an option to dump just the types, without sizes?
When I have to investigate a corrupt binlog, I usually have the good and the bad binlogs. So I dump a flat list of records to see which record is the first broken one. Even the record number and kind would be valuable, but if we can have the size of each record it'd be better (for completeness). If the size of the corrupted record changes, would be nice to know it.
We could deduce the record size from the start positions of records in the stream (this is how we show the progress bar when reading the binlog). But of course in the new format we get the record sizes for free.
Fixes #741
Context
741 brought a nice idea. I needed something similar for my investigation - just counts, not sizes - so I stitched something for both.
Samples
Just summary on OrchardCore (runs for about 0.7s on my machine):
Details for binlog from new console:
Limitations
Breaking changes
BinLogReader.WrapperStream
was removed. It was public, but hopefully nobody was using it. If yes - they can easily switch toTransparentReadStream
.Perf
Summary for OrchardCore runs ~0.178 seconds with the new binlogs (offsets included), ~1.967 seconds with old binlogs. Both after warmup runs. On full details dumping the difference is not so visible, as majority of the time is spend flushing the records (it's ~56 vs ~58 seconds)