I am going for hernia operation next two weeks. I have thing kind of phobia of acute pain. What do you do if the analgesia etc is ineffective?

Hernia. No worries. There will be experienced anesthesiologist who will monitor your response & intervene accordingly.
Local anesthestics. Talk to your doctor about local anesthesia, nerve blocks and appropriate oral opioids for after the surgery.