The film misleads us about that. In the novel, Luca's interaction with the Tattaglias took months before he met with Sollozzo. His mission was to find out what he could about Sollozzo's plans. After months with little progress, Vito told Luca to keep trying, but only as a sideline.
Luca made it clear to the Tattagials that he would never oppose Vito. The night of the meeting, Luca donned a bulletproof vest and a cold pistol in case he could dispatch Sollozzo at the meeting. So, Luca realized the risk and was prepared.