sequence id is numbered when INSERT SQL executed..
INSERTed row become visible from other transaction when it's COMMITed..
Mastodon does .. 1. create status(INSERT) 2. process tag, emoji, mentions, attachments 3. COMMIT. ... There is long time gap between INSERT and COMMIT.
@aschmitz @unarist @Gargron Note: We should taking care about API should return statuses as many as DEFAULT_STATUSES_LIMIT when there is more statuses in range when filtering redis result. Returning statuses count < DEFAULT_STATUSES_LIMIT has meaning there is no more statuses in requested range. When removing max_id and since_id, 2 more statues we should get from redis.
@aschmitz @Gargron @unarist
I only try to clarify problem.
Problem 2 is not a problem for current PR's implementation. I think.
'sequence data' part of id have enough randomness and ids with same 53bit prefix does not happen.
Some tries to make 'sequence data' sequencial will affected by problem 2. If same 53bit prefix occurs, some problem occurs I think.
@Gargron @aschmitz @unarist
There are 2 problems.
1. Id non-sequentiality within msec. It causes lack of status when getting new status.
2. Redis key precision problem
Additional filtering for redis result can solve 2, but can't solve 1.
Returning same msec statuses at range border can solve both 1 and 2, but It causes status dup rarely and client should dedup them.
Public page should do some additional filtering for dedup (I think public page does not have 'read new' function).
@Gargron @aschmitz @unarist I guess what it means:
Current snowflake id which Mastodon uses does not sequential within msec.
So, Don't return same msec status may cause lack of status within msec when some cases in paging.
Returning same msec status help clients for getting all status, but it causes duplication of status when there is statuses which created in same msec.
So, client should perform dedup and ignore statuses already got when calling REST API.
じさばどん