Definitely replace it if there are only a few pages left and bring the cancelled passport with you for transfer to the new passport. I had a horrible experience recently with a wet passport on a few pages that I thought would be 'no big deal' but it was a huge problem.