For decades, the most predictable thing about Albany – a maddeningly unpredictable place, generally speaking – was that the Republicans controlled the state Senate and the Democrats reigned supreme over the state Assembly on the other side of the Capitol.

This made passage of certain legislation difficult, and it frustrated advocates, particularly progressives, who saw bills on controversial issues like gay rights, abortion and campaign finance reform routinely blocked by conservatives in the upper house.

The political split was a boon to many governors, however – both Democrat and Republican – providing them with a handy foil to blame when things they were supposed to want, but secretly didn’t, failed to pass.

There was long a silent truce between the late former Democratic Gov. Mario Cuomo and the Republican leadership in the state Senate, in which the executive, who had a national reputation as a liberal lion, largely stayed out of his own party’s efforts to flip the upper house come election season.

Status quo no longer

But for the last decade, things in the Senate have grown increasingly complicated – a phenomenon born of a combination of forces.

That includes, but is not limited to, dwindling population in the traditional GOP stronghold of upstate, Democrat enrollment growth in the Hudson Valley and on Long Island, and a thin bench of local Republican talent to replace veteran aging incumbents.

It all started in 2008, when the Democrats, propelled by a surge of new voters, won a majority in the Senate. This put the party in control of both houses of the Legislature and the governor’s office for the first time since the New Deal.

But after being out of power for so long, the Democrats were not ready to lead. Their time in the majority was tumultuous, marked by the defection of two renegade members to the GOP side. Only one returned to the fold, effectively deadlocking the chamber for a full month in the summer of 2009.

Finally, Gov. David Paterson, who was abruptly elevated to his post due to the prostitution scandal and subsequent resignation of his predecessor, Eliot Spitzer, appointed a lieutenant governor to succeed him.

His selection, veteran government operative Richard Ravitch, was able to cast a tie-breaking vote in the Senate, which ended the stalemate as quickly as it started.

GOP brokers deals with Dems

The Republicans won back control of the Senate by the narrowest of margins in the 2010 elections, and were given some breathing room by the defection of a newly elected conservative Democrat, Simcha Felder, of Brooklyn, who decided to caucus with the GOP.

In 2012, Democrats won a numeric majority in the 63-seat Senate, but Republicans managed to retain control by striking a never-before-seen power-sharing deal with a breakaway group of four disgruntled Democrats known as the IDC – short for the Independent Democratic Conference  - led by Bronx Sen. Jeff Klein.

In 2014, the Republicans – still with Felder in their camp – won a “clean” majority, albeit still narrow.

The GOP conference no longer needed to share as much power with Klein, though the IDC grew its numbers, reaching eight members at its peak, and continued to operate as an independent entity, caucusing on its own.

Cuomo wades into battle

Democrats have long pressured Gov. Andrew Cuomo to assist them in their quest to win back control of the Senate, arguing that all manner of progressive bills that he professes to support would pass if only the GOP was no longer in charge.

When he was up for re-election to a second term in 2014, Cuomo paid lip service to assisting his fellow Democrats in this effort as a condition for landing the union-backed Working Families Party line. But he never fully delivered on that pledge.

But the pressure from the left steadily mounted, and Cuomo, widely believed to be potentially eyeing a White House run in 2020 and needing to shore up his support among liberals, finally engaged when it came to the Senate.

He brokered a supposed “unity” deal between Klein’s factor and the so-called “regular” Democrats, led by Andrea Stewart-Cousins, of Yonkers , who would be the first black woman to lead a majority legislative caucus in Albany history were her side to retake control.

But that deal has proved to be shaky, at best, as a number of key players – including unions and elected officials – have defected to endorse primary challengers against erstwhile IDC members, concerned that surprise upsets in the June congressional primaries do not bode well for the status quo.

5 big races to watch

Currently, the Senate stands at 31 Democrats, 31 Republicans and Felder, who so far has remained loyal to the Republicans, though he has always said that whichever side provides the best deal for him and his constituents will get his leadership vote.

Democrats believe that an anti-Trump “blue wave” will propel them into the majority in the November general election. They are also encouraged by the fact that there are five vacancies in the Senate – all created by the retirement of Republican senators some of whom have been serving in Albany for decades.

Several of these seats – including two in the Hudson Valley where veteran Republican Sens. John Bonacic and Bill Larkin have declined to seek re-election – are in districts where enrolled Democrats outnumber Republicans.

On Long Island, where Sen. Tom Croci has bowed out of the race, Republicans also are at an enrollment disadvantage, but independents – voters not affiliated with any political party – will likely decide that race.

Republicans have a small voter enrollment advantage in the Central New York district currently represented by outgoing Deputy Senate Majority Leader John DeFrancisco, who opted not to run again after terminating a brief statewide run for governor.

Another likely safe GOP seat is the one in the Capital Region being given up by Sen. Kathy Marchione. That district was represented for years by former Senate Majority Leader Joe Bruno, who resigned in July 2008.