On Aug. 28, 2005, the New Orleans city jail held more than 6,000 people, giving it the highest per capita rate in America.

Most inmates weren’t violent offenders: Nearly nine in 10 had been picked up on minor charges like possessing marijuana or urinating in public. And because the vast majority were poor and could not afford bail, they stayed locked up for weeks or months, even though their charges rarely led to a conviction or a prison sentence.

The situation was intolerable and, it seemed, intractable. Then came the storm.

Over a few excruciating days, the whipping winds and rising waters that battered and drowned much of the city also unmasked the profound dysfunction of its most essential operations.

The jail network was among the hardest hit. In addition to widespread damage to buildings, many prisoners were abandoned in fetid floodwaters, while others endured chaotic transfers to distant jails.