I was finally able to simulate my problem with the full tranlog on a CDC enabled DB.
I created one table and enabled it for CDC.
– BEGIN TRAN
– INSERT records into this table filling up the tranlog to 95%. (not 100% because this will rollback the transaction and space in the tranlog can be reused after a tranlog backup)
CDC will only start filling up the capture tables after the final COMMIT but the CDC capture job also needs tranlog space to succeed filling up the _CT tables. On the other hand, the original tranlog entries can only be reused after the records are replicated. Good example of a logical deadlock
So the “CREATE DATABASE…FOR ATTACH_REBUILD_LOG” (previous blog) was not necessary if only the tranlog size was limited from the start, so there was some disk space free to enlarge the file just to handle this one big transaction.
I remember from the early days that transactions should always be as short as possible ant that file size should be defined up front.