Post stats anomaly due to migration?

Hi.
I was surprised by this peak:

There were no that much posts this day.
The only thing that comes up in my mind is that I split a topic in order to merge it with an existing topic which already had 97 posts. I don’t see why that should be added to the posts stats though.

Yeah splitting and merging has… edge cases… @david can you repro this?

3 Likes

Hi @Canapin - I’ve tried reproducing this but am not having much luck. I’ve tried:

  • Moving old posts between existing topics
  • Moving old posts to new topic

and neither has any impact on the posts graph in the admin panel.

If you have data-explorer installed, can you try running

SELECT posts.id as post_id, topic_id, topics.archetype from posts  
LEFT JOIN topics ON posts.topic_id = topics.id
WHERE topics.archetype <> 'private_message'
AND posts.created_at >= '2018-07-17 00:00:00' 
AND posts.created_at <  '2018-07-18 00:00:00'

That should show you all of the 100 posts causing the peak on the graph. Are there any that look out of place?

5 Likes

I have noticed a bit of weirdness with deleting posts in an unlisted topic causing a negative instead of zero.

@Canapin did you by chance do something like
unlist -> move -> list ?

1 Like

Hi,
I executed this request and it displayed the post from the old topic in which the new message were merged.

Te be more precise about what I did: I had a topic which contained only one reply. I selected both messages (so, the entire topic) and merged them in an existing ~100 replies old topic.

@Mittineague, I don’t remember doing such a thing.

1 Like

I just tried this:

  • Create new topic
  • Make a reply
  • Select both posts
  • “Move to existing topic”

When you do “move to existing topic” on the first post in a topic, it makes a copy of that post. The original topic still exists, and is “closed”. Therefore that first post is effectively counted twice. I think this is correct, as the topic has not been deleted. If you delete the topic, the count is correctly reduced.

Does that explain the spike you saw?

@Mittineague Are you talking about the ‘posts’ report in the admin dashboard, or individual user statistics. I cannot see any way that the ‘posts’ report would produce negative numbers :thinking:.

1 Like

Hi,
I’m not sure to fully understand (English’s not my first language btw).
If the first post is counted twice, it counts as two messages, but that doesn’t explain my 100 message spike.
Also, I deleted the remaining topic.

Did the data-explorer request show multiple posts from the old topic, or just one?

Are you able to share a link to the topic

This is the topic:


(I also deleted the last reply after the merge but I don’t think it’s relevant)

That’s very weird and I didn’t notice it before: when I did the merge, all the posts from the existing target topic (which is many years old as well as its replies) had their dates updated to the merge date! :scream:
All the 100 posts are now 8 days old…

Is it possible to restore their original date? :confused:

Also, my Discourse is an imported phpbb, I don’t know if that is an important info.

That explains the spike in the posts graph! It is probably related to the phpBB import, but it shouldn’t happen.

Can you try running this query please:

SELECT posts.id, posts.created_at, posts.updated_at, COUNT(post_revisions.id) as num_of_revisions from posts 
LEFT OUTER JOIN post_revisions
ON post_revisions.post_id = posts.id
WHERE topic_id = 9352
GROUP BY posts.id

Are the created_at and updated_at times correct? Or are they the date that you merged the topics?

Do all of the posts have a revision?

2 Likes

Hi,
All the created_at and updated_date date were updated to the merge date. :frowning:

:frowning: then I think the only way to get the old dates back will be to get them from the old forum.

Can you try running the same data explorer thing for another old topic (from phpBB). You just need to change the topic_id in the query. What do the dates look like for that?

1 Like

Sorry for not being more clear about the “some”. (I didn’t want to go off-topic)
You may or may not see them here in the Replies column
https://meta.discourse.org/latest?status=deleted

But I see some here
https://www.sitepoint.com/community/latest?status=deleted

* need to be logged in with permission

Hi,
They look like this:

I did rebake all the posts after my import, don’t know if it’s relevant.

That looks fine to me. The imported created_at times are missing microseconds, but that shouldn’t cause an issue.

Are you able to reproduce the problem on other topics (try merging a new post into an old topic that doesn’t matter too much)?

1 Like