Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Threads missing first post entries #83

Open
rossjrw opened this issue Sep 28, 2023 · 0 comments
Open

Threads missing first post entries #83

rossjrw opened this issue Sep 28, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@rossjrw
Copy link
Member

rossjrw commented Sep 28, 2023

The following query reveals 333 posts in the test dataset (2023-06-07) that are lacking an entry in the first post table:

select id, substring(title, 1, 20), wiki_id, creator_username, created_timestamp, (select count(*) from post where post.thread_id = thread.id) as post_count, is_deleted from thread where not exists (select null from thread_first_post where thread_first_post.thread_id = thread.id) order by post_count;

Of those, 16 have zero posts associated with them. Most have 1 or 2 posts; some have more, with the top having 47 and the second having 28.

Many, but not all, of these posts have actually been deleted from their wikis. None of them are marked as deleted in the database.

I don't know if this is causing problems or not.

It's possible that this is caused by the first post in a thread being deleted, but the thread remaining in place. This is entirely speculation, though. I actually think I would only have marked the post as deleted but not actually delete it in that case, so maybe not.

I assume re-running migration 1 will one-off fix the issue for the current dataset, but I'd really like to discover what the root cause is first.

@rossjrw rossjrw added the bug Something isn't working label Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant