A possible solution to resolving a mamzer problem is debated in the mishna based on a halacha learned in the previous mishna about the offspring of a Caananaite maidservant. If her offspring goes by her, then a male mamzer can marry her and have the master free the offspring in which case the offspring would be Jewish. The gemara derives that according to the opinion that allows this, it is permitted ab initio. And that opinion is accepted in halacha. However, nowadays in the absence of Caananite maidservants, this solution is not possible. The fourth perek begins with a description of all the differnet lineages of the people that came to Israel in the time of Ezra and who is allowed to marry who. There is a debate between Rava and Abaye about what happened historically. Did Ezra forceably remove all those with problematic lineage when he went to Israel to ensure that proper records would be kept and people wouldn’t marry in forbidden marriages or did he recommend it and most of them followed of their own free will.