djong1 / gp3s

gps-speedsurfing and more
6 stars 1 forks source link

Event sessions list incomplete on gps-wingfoiling.com #127

Closed Logiqx closed 1 year ago

Logiqx commented 1 year ago

Both events on gps-wingfoiling.com are missing sessions:

https://www.gps-wingfoiling.com/default.aspx?mnu=eventsessions&val=767 https://www.gps-wingfoiling.com/default.aspx?mnu=eventsessions&val=759

Both events list only one session yet there are lots of things in the rankings.

jhdebruin commented 1 year ago

Did a manual refresh, sessions are listed now. I will open a new issue , for auto processing events on wingfoil

Logiqx commented 1 year ago

Oddly the sessions used to be listed so something has caused them to disappear.

The sessions were listed two weeks ago when Dylan fixed issue #109.

djong1 commented 1 year ago

Thanks jan Hendrik, Please do not fix the ranking next time it happens. I have added additional logging to detect which function is causing the update. All updates are transactional replications towards an helper table. Since I moved the code base to fully serverless I assume that one of the functions is not fully idempotent and cannot handle the parallel scale out and is causing conflicting transactions. Sessions can be added and deleted by users but I moved away from processing changes in order because it could hang up the processing if one of them is blocked. In effect all the function must handle this correctly. I need some time to figure this bug out, sorry guys. But keep the feedback flowing, it really helps! Have a good start of 2023! @Logiqx @jhdebruin

Logiqx commented 1 year ago

@djong1 - no worries. Good luck in your diagnostics.

At the risk of saying something you already know, it should be possible to update the helper tables in a way that does not cause missing records in the event of a failure. SQL Server supports transactions so you should be able to build something which is "all or nothing" (i.e. it either works, or fails and the helper tables don't change).

https://learn.microsoft.com/en-us/sql/t-sql/language-elements/transactions-transact-sql?view=sql-server-ver16

djong1 commented 1 year ago

agree, but the user deletes a session - this will be handled by the delete transaction, but I also have compensating transactions to update helper tables for spots, event etc. The problem is with the compensating transactions combined with random order processing. maybe I made it too complex, but I wanted to get rid of long transactions that hold the whole system ( scalability).

Logiqx commented 1 year ago

On a related note the event rankings are looking way better now. Since your bugfix two weeks ago the only issues (aside from the disappearing sessions) are a few duplicates on gps-speedsurfing:

https://logiqx.github.io/gp3s-query/gps-speed/events/

All of the other sites are currently looking fine. Well done in fixing all of the other data integrity issues. :)