My concern is that even if one plans for a sufficient capacity, there still needs to be testing done to verify that the code actually works if the capacity is nearing the theoretical limit. In this example the database id was transformed into a 32 bit integer somewhere in the application code.
Usually when I hit some sort of unexpected bug in production I try to think about what type of testing will prevent similar problems in the future.