It's Election Day again in a handful of states, and a year after President Trump upset Democrats, candidates have a lot to prove about the health of their party. Nowhere is that more true than a key governor's race in Virginia.

The Virginia governor's race is one of the most competitive elections since Trump won. Whichever party wins in Virginia could shape the national conversation for congressional elections in 2018 and decide the balance of power in the commonwealth for a generation.

Virginia, perhaps more than any other state, reflects the national mood after a presidential year. The state's governor is limited to a single four-year term, so the race always follows a presidential election year.

“Virginia is an early warning system and a testing ground for what we're going to see play out in the next midterms,” said Jesse Ferguson, a former top aide on Hillary Clinton's campaign. For Democrats, holding onto the governor's mansion after a Trump win is a crucial part of their national strategy to try to take back control of state legislatures and even Congress.

And yet, despite Trump's historic unpopularity and Republicans' struggles to repeal Obamacare, Democrats are slipping in this race. Lt. Gov. Ralph Northam (D) has had a steady lead in the polls since he won his primary, but his once-double-digit lead over Ed Gillespie (R) narrowed to an almost imperceptible one as Election Day neared.

Historical trends suggest that if Republicans win the governor's office in Virginia on Tuesday, they will likely keep the House of Representatives in 2018. Ferguson, a Virginia native, points out that the last three times the House has switched power, so did the Virginia governor's mansion a year before. Going back to Lyndon B. Johnson's election, nearly every time one party won the White House, the other party won the Virginia governor's race the next year, he said.

The stakes for this particular election are even higher than how Democrats do in midterm elections next year. If Democrats want to regain a foothold in Virginia in the next decade, they need a Democrat in the governor's mansion right now. The governor who gets elected on Tuesday will get to sign off on (or veto) new state and congressional electoral maps in 2021. If Republicans win the governor's mansion, they could have control of Virginia for a generation.

That may sound hyperbolic, but it reflects just how much the balance of power has shifted over the past decade to Republicans in states such as Virginia.

Republicans have managed to gain control of nearly two-thirds of statehouses (including in Virginia, where Republicans have a 2-to-1 majority in the House of Delegates) before most state legislatures got to redraw electoral maps in 2011. Now, Democrats are in too deep of a hole to win back a significant number of state legislatures by 2021. But governors elected in 2017 and 2018 will be in a position to veto those maps.

“I truly believe that if we don't win these states races — particularly governors' races — in 2018 [and 2017], we are going to have another decade of lost Democratic leaders,” Elisabeth Pearson, executive director of the Democratic Governors' Association, told The Fix shortly after Trump got elected.

Another reason Democrats need a win in Virginia: They want to prove that Trump's conservative policies don't win elections in swing states. Gillespie's race has echoed Trump's key policies, from getting tough on majority-Latino gangs to keeping Confederate statues to blasting sanctuary cities. If Gillespie wins, Republican operatives will see it as a sign that they have figured out how their candidates can embrace Trump's policies without turning off swing voters.

If he's successful, we can expect Republicans across the country to deploy similar tactics,” said Carolyn Fiddler, a blogger with the liberal Daily Kos. 

By contrast, Northam's last word to voters has basically been: I'm going to stand up to Trump.

“I sponsored this ad because I’ve stood up to Donald Trump on all of it,” he says in an ad running on Election Day. “Ed Gillespie refuses to stand up to him at all.”

If Northam wins Virginia's governor's race, Democrats can finally say they ran an anti-Trump campaign on a statewide level and won, a playbook they will try out again and again in next year's key congressional and gubernatorial races. If Northam loses a race that arguably favors him, well, Democrats may have to start from scratch on how to defeat Republicans in the era of Trump.