It is well-known that quantitative, scale invariant absolute continuity (more precisely, the weak-A∞ property) of harmonic measure with respect to surface measure, on the boundary of an open set Ω⊂Rn+1 with Ahlfors-David regular boundary, is equivalent to the solvability of the Dirichlet problem in Ω, with data in Lp(∂Ω) for some p<∞. In this paper, we give a geometric characterization of the weak-A∞ property, of harmonic measure, and hence of solvability of the Lp Dirichlet problem for some finite p. This characterization is obtained under background hypotheses (an interior corkscrew condition, along with Ahlfors-David regularity of the boundary) that are natural, and in a certain sense optimal: we provide counter-examples in the absence of either of them (or even one of the two, upper or lower, Ahlfors-David bounds); moreover, the examples show that the upper and lower Ahlfors-David bounds are each quantitatively sharp.