My 2 year old has a gum infection and the dentist wants to do a root canal. Is this normal?

Pulpotomy. When a baby (primary) tooth abscesses, it typically will swell the gum tissue right near the tooth. Most dentists recommend to maintain these baby teeth until the permanent teeth are ready to come in to maintain the space. To do this the procedure that involves a "root canal" on baby teeth is called a pulpotomy.
Gum infection. First approach should be to treat the infection. If successfully treated, I would doubt a root canal is indicated.
Pulpotomy. If you have a tooth abscess it's probably because it first was a tooth cavity. A baby root canal or pulpotomy would be in order if you wanted to save the tooth however it doesn't address the infection and the infection may get worse. Beware of saving teeth and keeping infections.
Second Opinion. Something sounds unusual. How does a 2 year old have a cavity that involves the nerve? Get a second opinion and discuss causes and prevention with the dentists.