hivemind icon indicating copy to clipboard operation
hivemind copied to clipboard

Wrong follower/following counts

Open steemchiller opened this issue 6 months ago • 11 comments

On steemit.com I see this:

Image

steemworld.org (using SDS) shows this:

Image

steemchiller avatar Jun 02 '25 08:06 steemchiller

There are some more accounts in my production hivemind node:

db=# select name,followers,following from hive_accounts where following<0 limit 10;
      name       | followers | following
-----------------+-----------+-----------
 divia           |        51 |        -8
 blordofficial   |         6 |        -1
 sdfgtu          |         1 |        -1
 bullionstackers |      7446 |      -541
 hezeqc          |         0 |        -1
 zulkiflibayu    |         7 |        -1
 luxalok         |        11 |        -1
(7 rows)

only-dev-time avatar Jun 02 '25 09:06 only-dev-time

@only-dev-time Interesting, I wonder why the counts are different in your production node. Are you running a different version?

steemchiller avatar Jun 02 '25 11:06 steemchiller

@steemchiller Yes, it's strange. I have 3 hivemind nodes and two different counts. poduction: bullionstackers | 7446 | -541 (current official db version 20; db build on a snapshot from @ety001) testing 1: bullionstackers | 7446 | -541 (db version 21 with my bookmarks implementation; don't know if I used a snapshot) testing 2: bullionstackers | 7448 | 1371 (db version 21 with bookmarks and new trending score; own sync)

only-dev-time avatar Jun 02 '25 11:06 only-dev-time

@only-dev-time Okay, so the testing 2 instance looks to be almost correct when it comes to followers. Also the following count looks much better. Still a big difference to what I get with SDS though. Hard to tell what's the correct count here. In any case, part of the problem seems to be related to a snapshot that was created with an older version.

steemchiller avatar Jun 02 '25 16:06 steemchiller

There is a force_recount method, does this help?

DoctorLai avatar Jun 02 '25 21:06 DoctorLai

I would prefer to have it run a full resync, so we can be sure that the parser/indexer works as it should. We should then provide new snapshots from that clean state.

steemchiller avatar Jun 03 '25 17:06 steemchiller

I tested some cases with @moecki.tests:

  • [x] three new follows/unfollows in one transaction,
  • [x] follow already followed accounts,
  • [x] unfollow not followed accounts,
  • [x] and some variations.

All are correct processed by hivemind and steemworld. (BTW @steemchiller: This transaction with wrong syntax caused an error on steemworlds account operations tab. Sorry)

I could run force_recount on testing1 before we fully resync.

only-dev-time avatar Jun 03 '25 19:06 only-dev-time

@only-dev-time Thanks for the info! Should work now ;)

steemchiller avatar Jun 03 '25 20:06 steemchiller

After force_recount there are better results:

db=# select name,followers,following from hive_accounts where following<0 limit 10;
 name | followers | following
------+-----------+-----------
(0 rows)
db=# select name,followers,following from hive_accounts where name='bullionstackers';
      name       | followers | following
-----------------+-----------+-----------
 bullionstackers |      7448 |      1961

only-dev-time avatar Jun 04 '25 15:06 only-dev-time

I would suggest to add a optional start parameter to forcing recount in Sync.run() before updating the chain state.

only-dev-time avatar Jun 06 '25 20:06 only-dev-time

#351 has been merged.

Haven't the causes of the quantity calculation error been confirmed yet?

ety001 avatar Jun 11 '25 04:06 ety001

https://steemit.com/@bullionstackers still shows a following count of -483. With SDS I get 2128.

steemchiller avatar Nov 08 '25 10:11 steemchiller

I checked it on my testing2 hivenode:

before recount:

      name       | followers | following
-----------------+-----------+-----------
 bullionstackers |      7453 |      2107

after recount:

      name       | followers | following
-----------------+-----------+-----------
 bullionstackers |      7453 |      2128

Now it matched with SDS data. There is clearly a bug in hivemind when processing follow ops.

Now I'm running an observation script.

only-dev-time avatar Nov 08 '25 16:11 only-dev-time