Before asking, I apologize if this question is duplicated. It seems a sort of basic stuff and I tried to find the reference, but I couldn't find it(only the statement without the proof appears in the textbook of Goldfeld and Hundley, Automorphic representations and L-functions for general linear groups).
Let $G:=GL(n,\mathbb Q_p)$, which is a topological group and $K_j:=I_n+p^j M_n(\mathbb Z_p)$. It is known that $\{K_j\}_{j \geq 1}$ forms a base of neighborhoods of $I_n$ (this comes from the fact that $p^j \mathbb Z_p$ form a base of $0$ in $\mathbb Q_p$. $M_n(\mathbb Q_p)$ is just a product space of $\mathbb Q_p$, and $G$ is its subspace). It is also known that $K_j$'s are open, closed, and compact (which is not hard to verify).
The Haar measure $\mu$ on $G$ is also well-defined by setting that $$ \mu(gK_j)=\mu(K_j g)=\frac{1}{[K_0:K_j]}\mu(K_0) $$ for any $g \in G$, where $K_0=GL(n,\mathbb Z_p)$.
If $f:G \to \mathbb C$ is a smooth(i.e., locally constant) function, then we may define the integral of $f$ over $G$ $$ \int_G f(y)d\mu(y), $$ which is left and right invariant.
I would like to check that this integration always converges. Since $f$ is locally constant, we may choose $K_{j_x}$ for each $x \in G$ and $c_x$ such that if $y\in xK_{j_x}$ then $f(y)=c_x$.
We may assume that the union $\bigcup_x xK_{j_x}$ are disjoint. Indeed, if $xK_{j_x}$ and $yK_{j_y}$ have the non-empty intersection, then $xK_{j_x} \subseteq yK_{j_y}$ without loss of generality so that $c_x=c_y$.
Therefore, the integral of $f$ over $G$ is by definition $$ \sum_x c_x\mu(K_{j_x}). $$
However, I don't know how one can prove that this sum converges. I guess that $[K_j:K_{j+1}]=[K_{j-1}:K_j]$ for $j \geq 1$ so that the sum is something like a geometric series, but how I show that $\mu_{K_{j_x}}$ is really 'shrinking' if one properly order the sum?
Thank you so much for reading and attending to this question.
Aphelli pointed out that we need the 'compactly supported' condition. If we have, then the sum is just a finite sum so the assertion is obvious.
However, the assertion is not true in general since we can easily construct a counter-example by taking large $c_x$. The question is closed.