I covered this back in 2009, but figured a little review (with some new addition) doesn't hurt. We have torrential rains in NY (to quote my wife: the last time it rained this much Noah was putting his zoo together) that are not expected to stop before nightfall. How does that impact the mitzvah of sukkah?
The Rishonim ask: the gemara (Brachos 49) writes that there is a chiyuv to eat a seudas Y"T with bread, and therefore if one forgets yaaleh v'yavo one has to repeat bentching. The gemara (Sukkah 27) has another din learned from a gezeira shava of Sukkos to Pesach that one is obligated to eat a kzayis in the sukkah tonight. Why do we need this latter din when we already know that we have to eat a seudah of bread tonight because it is Y"T?
A few answers are offered: 1) Tos (Sukkah 27) answers that really on Y"T there is no obligation to eat bread. The sugya that says you have to is speaking only about the night of Sukkos or Pesach, when we have that gezeira shavah that obligates us. According to this view, if you leave our yaaleh v'yavo in Y"TNoa bentching you would not repeat. 2) Other Rishonim says the nafka mina is the shiur. Normally, a person has to eat a k'beitza to be yotzei seudas Y"T. The gezeira shava elevates the importance of the eating of a k'zayis so that one is yotzei with that. 3) Rosh answers that had we only had the chiyuv to eat because of seudas Y"T, when it rains, you could eat inside. The gezeira shava teaches us that on the night of Y"T one must eat a k'zayis in sukkah regardless of the weather.
Since the other Rishonim did not give the Rosh's answer (which is quoted l'halacha by the Rama), one can assume that they did not accept his chiddush, and that even on the first night of sukkos one is not obligated to sit in the sukkah in the rain.
The nekudas ha'machlokes (see the older post for a different hesber): yesh lachkor whether the chiyuv of sukkah on the first night is a mitzvah of achila, like achilas matzah, or a mitzvah of dirah, to live in the sukkah, which you do by eating there.
If it is a mitzvah of dirah, then when it rains, one should be patur. You don't live in your house when there is rain pouring through the ceiling -- that's not called dirah. If it is a mitzvah of achila, then rain makes no difference. If it rains on leil ha'seder, you still eat a k'zayis of matzah.
There are other issues that may hinge on this same chakira. If one stole a k'zayis and ate it in the sukkah tonight, is it a mitzah ha'baah b'aveira (R' Baruch Ber's question)? Is the mitzvah achilas k'zayis, or is the mitzvah sitting in sukkah, and you never stole the sukkah? The Yerushalmi has a safeik (discussed by Rama as well) whether one must avoid eating a meal after chatzos on erev Sukkos in order to be able to enjoy eating that k'zayis in the sukkah just like you cannot have a meal on erev Pesach in order to relish that first bite of matzah. Again, the issue seems to be whether the focus is on eating, or on dirah.
Bottom line: even if it rains, to be yotzei the shitas haRosh quoted by Rama you should eat a k'zayis in the sukkah and then continue the rest of the meal inside.
GR"A throws one more wrinkle into the equation. He holds (Maaseh Rav, also quoted by Chayei Adam) that when it rains on the first night, even if you've eaten your k'zayis to be yotzei the Rosh, if it then stops raining, even at 3:00AM, you have to go out and eat another k'zayis of bread in the dry sukkah. The M.B. asks why this should be so. M'mah nafshach: according to the Rosh, you were yotzei with the k'zayis you ate in the rain. According to the other Rishonim, just like you were exempt because of 'mitzta'ar pature min ha'sukkah' when it rained, you are exempt because of 'mitzta'ar pature min ha'sukkah' from having to wake up at 3:00AM?
What we see from the GR"A (he has other Rishonim to back it up) is a new chiddush: the gezeira shava does obligate a person irrespective of the weather, irrespective of tzaar, like the Rosh holds; however, a sukkah with rain falling through the roof is not a sukkah. There is a chovas ha'gavra, but you have no cheftza shel mitzvah to fulfill it with. Therefore, once it stops raining and you have a livable sukkah, you have to go out and take advantage.