Barnett was hired last November after serving as the Astros' minor league hitting coordinator from 2009-10. Brocail had served as interim pitching coach since June 14.
The contracts mean the Astros' entire major league coaching staff will return in 2012. Following the 2010 season, third base coach Dave Clark, first base coach Bobby Meacham, bench coach Al Pedrique and bullpen coach Jamie Quirk were all signed to two-year contracts. Manager Brad Mills is signed through 2012 with a club option for 2013.