PostTV’s “In Play” looks at how a recount in the Virginia attorney general race would work and when it might end. (The Washington Post)

As the dust settled on election night, a few things seemed clear about the race for Virginia attorney general: It was too close to call, the numbers would change during a statewide canvass and the loser would probably ask for a recount.

What was then a standard-issue tight contest between state Sens. Mark D. Obenshain (R-Harrisonburg) and Mark R. Herring (D-Loudoun) has turned into something more dramatic and uncertain. A frenetic weekend search for the right numbers — much of it taking place at the Fairfax County Government Center — produced thousands of uncounted votes and an even closer race.

As of Sunday night, Obenshain led by 17 votes out of more than 2.2 million cast, according to the State Board of Elections Web site.

At times Friday, Obenshain led by more than 1,200 votes, but the totals have changed regularly since Tuesday. Some of the shift was due to a handful of mistakes attributed to human or machine error. Some of it was the result of the standard canvassing process that takes place after every election. Both types of adjustment are typical, and no one suspects wrongdoing. But in a typical year, these additions and subtractions don’t affect the outcome.

This year is different. The contest for attorney general is so close that the normal process of fixing errors and counting provisional ballots has caused the results tally to narrow dramatically in an already close race.

And the results are likely to continue shifting, with provisional ballots unreported in one large locality, Fairfax County, and possibly incomplete in another, Richmond. No matter what, the race — with a margin smaller than 0.001 percent of the vote — is almost certainly headed for a recount that won’t be decided before December.

Michael McDonald, a professor of government and politics at George Mason University and an expert on voting, said Virginia was unusually transparent compared with most states when it comes to reporting election results online in real time.

That can be good or bad depending on the circumstances.

“If it wasn’t a very close election, no one would be looking at the sausage being made,” McDonald said.

David Wasserman, an editor with the nonpartisan Cook Political Report who has been closely monitoring the Virginia results, said that mistakes are “routine” in elections. “That might scare a lot of voters,” he said.

Wasserman said that as of Sunday afternoon, it appeared that most localities had reported their updated numbers to the state board. Many areas had not finished counting their provisional ballots — cast by people who lacked identification or went to the wrong polling place — but those numbers are tiny in most jurisdictions.

In a post-election canvass, local electoral boards check the numbers they reported to the state board on election night for signs of error or inconsistency. They also typically recheck the numbers recorded by the voting machines.

“I don’t anticipate that there are major shifts in the vote outstanding beyond Fairfax County and the city of Richmond,” Wasserman said. “Those are the two localities that the lawyers have descended upon.”

In Fairfax, the main problem began with a single optical-scan machine in the Mason Governmental Center on Columbia Pike.

The machine malfunctioned after recording 710 ballots during early voting. Those ballots were fed again into a working machine, which also tabulated additional ballots, producing a total of 2,688 votes. But at the end of the night, the 710 from the broken machine were mistakenly added to the precinct total, while the 2,688 were not.

That error meant nearly 2,000 votes were not counted. Additionally, more than 1,000 other votes were added after the discovery of multiple other errors unrelated to that one machine, said Brian W. Schoeneman, a Republican member of the Fairfax Electoral Board.

“The reason why we do the canvass is to find errors like this,” Schoeneman said.

The focus in Fairfax is now on the provisional ballots.

Missing votes also were found Friday in Bedford County, near Roanoke, where 732 votes were added after the discovery of human error or technical problems. The county leans Republican, and 581 of the added votes were for Obenshain.

McDonald said that social media had added a new twist, as professional and amateur political operatives pore over the numbers and report what they see — particularly potential errors — on Twitter.

“What we’re seeing is this new era of crowd-sourced certification of election results,” McDonald said.

“We would have inevitably found it because those numbers just did not add up,” Schoeneman said.

Laura Vozzella in Richmond contributed to this report.