You should definitely prepare a rigorous corrigendum, outlining what exactly should be disregarded and adjusted.
Whether or not your error warrants a retraction is impossible to say for an outsider. If you genuinely believe that the core of your paper is still valid (as you seem to), I’d file the corrigendum and a cover letter with the editor and let them decide. The most urgent retraction reasons include manifestly false results or those based on fraudulent (or false) data. In your case it sounds more like a question of loss of statistical significance (17 instead of 20 studies). How impactful that is, hard to say.
An informal way to think about this would be to ask yourself: after all necessary adjustments have been made, am I still proud of my paper? If yes, go for the corrigendum.