Commonly a kdb tick architecture is used to capture data. Part of this is a TP/TickerPlant that recives data, captures it to log and forwards messages on. That log is used for playback and recovery. If it somehow becomes corrupt you will receive a 'badtail error when trying to play it back.

Replaying Tickerplant Log File using -11!

Here we create a log file and replay it successfully using -11!

Badtail Error caused by corrupt log

A common cause of badtail errors is if a disk is full and the log is truncated. I recreated this by trimming the log and trying -11! again:

Workaround for badtail Error

To workaround a badtail error we can use a special -11!(-2; logFile) command to find how many chunks are valid and then use -11(chunksNumber; logFile) to play back only up to that point.