A group of 8 Democratic senators broke from their party to join Republicans in voting to pass a plan to end the shutdown.