Best if you ask the National Maritime Center by phone at 1-800-IASKNMC, they can give you the answer.
But I think the answer would be to go ahead and renew, submit the medical exam report with a letter from the referring physician explaining what the surgery and recovery time and prognosis is going to be. Doctor should check the "Recommended Competent" *and* the "Needing Further Review" boxes on page 9 of the CG-719K Medical form and give an explanatory comment in the box below saying something like :
"Capt A is medically fit and competent for the requested license except for a medical condition requiring an operation to correct it. That surgery is scheduled and if successful I expect Capt A will be fully competent thereafter (give more details)."
What I think they'll give you is a renewal with a Medical Waiver included, requiring proof of successful surgery and rehab, after which you send them another report then they'll rescind the waiver in writing.
Alternative is to renew "for continuity only" then get a new physical post-rehab etc and finish the renewal then.
Either way, you'll preserve the currency of your seatime and qualifications pending a clean physical after the operation.
But please don't take my word for it. Call the NMC, give them your Mariner number (or they'll give you one) and they'll tell you. this has to be a fairly common situation, for them if not for you.
Best wishes.