Sonoma County voters ushered in a game-changing reform Tuesday, choosing between rival Democratic candidates in two Assembly districts.

Statewide, 28 legislative and congressional contests had two Democrats or two Republicans on the ballot, the result of a new system that pits the top two finishers in the primary against one another, even if they're members of the same party.

The top-two system was one of two voter-approved reforms that took effect with the 2012 election. The other was creating an independent commission to draw new district boundaries.

Together, they produced close races — and ended the careers of several incumbents — across a state where the outcome of past elections could often be predicted before the first vote was cast.

One of the most competitive races was in the 10th Assembly District, which includes Marin and part of Sonoma County.

Assemblyman Michael Allen moved into the district after his Santa Rosa-based district was eliminated in reapportionment. Allen is a party leader in Sacramento, and his district almost certainly would have been protected if legislators were still drawing the boundaries.

The commission didn't defer to incumbency, and neither did San Rafael Councilman Marc Levine, who was implored by Democratic leaders to wait his turn, to defer to Allen.

Levine finished second in the June 5 primary. In past years, that would have been the end of his challenge. Allen would have run against Republican Peter Mancus in the general election, and, protected by an overwhelming Democratic edge in voter registration, he would have easily won a second term. Not this year.

Instead of a cakewalk, this is a cliff-hanger. After a spirited campaign, Levine finished ahead of Allen on election night by about 1,700 votes. It will take a few weeks to process all of the late-arriving absentee ballots, but the math favors Levine.

Regardless of the outcome, the top-two primary produced a competitive race where winning every vote — Democrat, Republican and independent — was important.

The results weren't this close in every district, of course. But legislative and congressional contests where the winner received more than 60 percent of the vote dropped from 106 of 153 in 2008 to 89 this year.

Close races aren't the only story of this week's elections. Another is that incumbents weren't invincible. Three congressional incumbents were defeated Tuesday, and two others are trailing as the vote count continues.

To put that in perspective, just one congressional incumbent lost a general election in California in the 10 years — and five elections — after new districts were drawn in 2001.

In the state Legislature, the only incumbent to lose in that same period was defeated in a primary. Allen is one of three incumbents at risk of losing in Tuesday's election.

We don't measure the value of an election by the number of incumbents who are defeated. We do, however, value competitive races that force candidates to appeal to a wide range of voters. From that perspective, California's election reforms are off to a good start.