Bloating is usually caused by too little sodium intake, though it isn't the only possibility. But if you have to err, it is easier to correct drinking too much than not drinking enough. By the way, you can't simply go by sense of thirst.
Most humans are terrible at calibrating body hydration status by sense of thirst.
When thirst does register, runners are usually seriously dehydrated. Runners who are 2-3 liters deficient will drink 0.25 liter of water and pronounce themselves hydrated. It is the same hormone which can cause bloating at a specific point in the menstrual cycle. You may have been running the marathon at that time, giving you a combination effect. My knees too feel a little numb when I run.