After 43 days, the longest US government shutdown in history is coming to an end.

Federal workers will start receiving pay again. National Parks will reopen. Government services that had been curtailed or suspended entirely will resume. Air travel, which had become a nightmare for many Americans, will return to being merely frustrating.

After the dust settles and the ink from President Donald Trump's signature on the funding bill dries, what has this record-setting shutdown accomplished? And what has it cost?

Senate Democrats, through their use of the parliamentary filibuster, were able to trigger the shutdown despite being a minority in the chamber by refusing to go along with a Republican measure to temporarily fund the government.

They drew a line in the sand, demanding that the Republicans agree to extend health insurance subsidies for low-income Americans that are set to expire at the end of the year.

When a handful of Democrats broke ranks to vote to reopen the government on Sunday, they received next to nothing in return – a promise of a vote in the Senate on the subsidies, but no guarantees of Republican support or even a necessary vote in the House of Representatives.

Since then, members of the party's left flank have been furious.

They've accused Senate Democratic leader Chuck Schumer – who didn't vote for the funding bill – of being secretly complicit in the reopening plan or simply incompetent. They've felt like their party folded even after off-year election success showed they had the upper hand. They feared that the shutdown sacrifices had been for nothing.

Even more mainstream Democrats, like California's Governor Gavin Newsom, called the shutdown deal pathetic and a surrender.

I'm not coming in to punch anybody in the face, he told the Associated Press, but I'm not pleased that, in the face of this invasive species that is Donald Trump, who's completely changed the rules of the game, that we're still playing by the old rules of the game.

If he is running for the pitchforks, it's not a good sign for Democratic leaders.

For Trump, in the days since the Senate deadlock broke on Sunday, his mood has gone from cautious optimism to celebration.

On Tuesday, he congratulated congressional Republicans and called the vote to reopen the government a very big victory.

While several government departments will be funded until September in the shutdown-ending agreement, Congress will have to approve spending for the rest of the government by the end of January to avoid another shutdown.

Democrats, licking their wounds, may be hankering for another chance to fight.

Meanwhile, the issue they fought over – healthcare subsidies – could become a pressing concern for tens of millions of Americans who will see their insurance costs double or triple at the end of the year. Republicans ignore addressing such voter pain at their own political peril.

It was all a very clear reminder that the best-laid plans and political strategies can be derailed in a flash.