I used geth to sync the blocks in mainnet, but the sync last for a long time.
eth.syncing shows the current block is 6154852, near the highest block. But eth.blockNumber shows 0. Why does this happen? And will the sync finish?
You are doing a fast sync, which is not complete until the entire state trie has been retrieved. This process takes a long longer than syncing the blocks themselves.
As of July 29th, there 181,012,156 state entires. You're currently around 50m. It will take a few days to catch up