We develop a new analysis for residual-type a posteriori error estimation for a class of highly indefinite elliptic boundary value problems by considering the Helmholtz equation at high wavenumber k > 0 as our model problem. We employ a classical conforming Galerkin discretization by using hp-finite elements. In [Convergence analysis for finite element discretizations of the Helmholtz equation with Dirichlet-to-Neumann boundary conditions, Math. Comp., 79 (2010), pp. 1871-1914], Melenk and Sauter introduced an hp-finite element discretization which leads to a stable and pollution-free discretization of the Helmholtz equation under a mild resolution condition which requires only O(kd) degrees of freedom, where d = 1; 2; 3 denotes the spatial dimension. In the present paper, we will introduce an a posteriori error estimator for this problem and prove its reliability and efficiency. The constants in these estimates become independent of the, possibly, high wavenumber k > 0 provided the aforementioned resolution condition for stability is satisfied. We emphasize that, by using the classical theory, the constants in the a posteriori estimates would be amplified by a factor k.