Fair value measurements - Percentages of Total Commodity Sales Excluding Effects of Hedging Activities (Detail) - Predecessor - Customer Concentration Risk - Commodity Sales
12 Months Ended
Dec. 31, 2016
Dec. 31, 2015
Dec. 31, 2014
Coffeyville Resources LLC      
Counterparty Credit Risk      
Percentage of sales to significant purchaser 19.30% 14.50% 14.00%
Valero Energy Corporation      
Counterparty Credit Risk      
Percentage of sales to significant purchaser 15.60% 20.70% 23.70%
Phillips 66 Company      
Counterparty Credit Risk      
Percentage of sales to significant purchaser 15.10% 11.80%