While debugging WT-6257, I noticed a bug with our handling of WT_RESTART in history store insertion. If we successfully insert a non-timestamped history store record, we go on to attempt to delete any timestamped history store records for that key. If this key deletion process involves reading in a split page, we will return WT_RESTART. Instead of resuming key deletion, we repeat the entire process again meaning that we will insert the same record again with a slightly higher hs_counter.
I don't believe that this could cause any visibility issues but it's a waste of cache and disk space and make things confusing for debugging so we should fix this.