The CFI that I am flying with is experiencing health issues and may not be able to fly anymore. If I switch to a different instructor will I have to redo flight time with the new instructor or is it perfectly OK to log flight instruction with different instructors. So far I have only about 4 hours instruction and have not soloed. My jurisdiction is the USA.
You will not need to repeat the hours. I flew with two different instructors during my training due to my first one heading off to the airlines and it was not an issue, as a matter of fact its pretty common. The FAA considers flight time, flight time. Once you logged the hours they are yours for the rest of your life.
However the new instructor will most likely have you repeat some of the stuff you went over with the first CFI just to see where your skills are at. If you only have 4 hours under your belt is likely you have just done turns, climbs, decents, and possibly stalls so switching instructors will be no issue. It takes a fair bit of time to build a rhythm with an instructor anyway.
Just some advice, if you are at a flight school that has a few others to pick from its worth it to ask them what their intentions are. Most instructors are there to build hours towards ATP then its off to the airlines. You should ask instructors how many hours they have left if they are going to ATP out, the more hours they have the longer they will be around. This will help you prevent the situation where you have to change instructors again.
Your flight time expires when you expire!
Beyond that, your new instructor may be the one that has to "sign you off" when your training is complete so regardless of the number of hours you have with someone else (even beyond the minimums), you must still perform well enough that that instructor will sign your 8710 for you. There are some regulations concerning how much time an instructor has to have with you before signing you off. You can find those in FAR 61.103.
FWIW - My wife went through five instructors (for various reasons) and each instructor wanted a quick flight to see where she was at in her training. Switching instructors happens for a variety of reasons. If you are not comfortable, switch. It is your money and your training!