Why did taking the pedals off and putting them back on again make it go away?

How many miles do pedals usually last? I bought mine last July, and since then have put approximately 8,000 miles on them.