Update: Bernie Sanders won the Michigan primary Tuesday night in what, according to polls, was a shocking upset. This post has been updated.

Hillary Clinton lost the Michigan primary on Tuesday night, and the state pried open two critical seams holding her candidacy together.

This isn't a fatal blow, but rather than punctuating a moment of triumph for Clinton, the state shows that the fight is, at least, pretty far from over.

Clinton was supposed to win Michigan. In the Real Clear Politics polling average in the state, Clinton led by 20 points coming into Tuesday night. And then she lost. What happened?

One thing that happened is that Clinton underperformed with black voters in the state. In Mississippi, which Clinton won easily, nearly two-thirds of the vote was black and it went for Clinton 9-to-1. Preliminary exit polling in Michigan suggests that only about a quarter of the electorate in the state was black -- and that Clinton's margin was closer to 2-to-1.

For as much emphasis as we put on race in the Democratic presidential contest, it's important to note that states in which one or the other candidate does well tends to pull the whole electorate toward that candidate. In Mississippi, Clinton won whites, which is not the case nationally or in places where Sanders does well. This appears to be Sanders's best performance with black voters so far this year. These are preliminary polling results, too, which will be re-weighted. If there's a large portion of the black vote still out, the final split could change.
Democratic presidential candidate Bernie Sanders expresses confidence in Miami following Democratic primary elections in Mississippi and Michigan.

If it doesn't change, though, this is a big hole in Clinton's safety net. Clinton needs huge black margins to walk to victory. If she has good margins, she'll almost certainly still win -- in part thanks to her existing lead -- but this thing won't be wrapping up any time soon.

Part of the problem may be the economic issues central to Michiganders' concerns. We noted a few weeks ago that the state has shed a ton of manufacturing jobs over the last 25 years, thanks in part to free-trade agreements like NAFTA.

In exit polls, nearly six in 10 voters thought trade took away American jobs -- and nearly six in 10 of people who said that, backed Sanders. Those who thought trade created jobs were slightly more likely to back Clinton. This echoes the Republican side of the primary. More than half of voters thought that trade cost jobs; four in 10 of them backed Donald Trump.

This is an issue that's very important to Michigan -- but also to other Rust Belt states, including Ohio, which votes next week. It gets to the key distinction that Sanders has been hammering for months, that he will address economic insecurity and that Clinton won't. Trade in Michigan is a very specific iteration of that issue. But it's clearly a point of weakness for Clinton. In a recent national poll, the thing people worried about most with Clinton's candidacy was her connection to Wall Street. That probably didn't do her much good in Michigan.

These are not the only factors at play. More than a quarter of the vote came from independents and Sanders won seven-in-10 from that group. The number of voters under the age of 30 appears to be up over 2008, too -- though that year was a weird one. Those aren't really a big problem.

Race and money, though? These are warning signs -- warning signs that are still hard to read and maybe warning signs that come too late for Sanders's candidacy. But Clinton very much needs to hold onto strong black support and to avoid concerns over how progressive she'd be as president. (As we've noted, Democratic voters this year are consistently more liberal than in years past.) Black voters are her (ahem) trump card and economic issues her Achilles heel.

Making Michigan the exact opposite of what she wanted to see.