-
Notifications
You must be signed in to change notification settings - Fork 57
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
bug: Automatic sharding with store not working #2616
Comments
@SionoiS WDYT? Are those content topics actually supposed to be equivalent? |
AFAIK we store content topics as string and so they are different at the DB level... 🤔 I'm not sure what to do exactly. I agree that they should be equivalent. I guess we could format content topics before storing them in DB? |
Yes, at the DB level they're different strings, nothing to do about it. |
I feel we should not use strings internally at all. We already have
|
Could someone elaborate what this
From spec it still confuses me. And I have been sending messages via |
Since autosharding maps infinite content topics to finite shards. We need to know the number of shards and the algorithm used for autosharding, that is what this number represent. In TWN gen
|
Revisiting this, I personally think that we should store in the DB the full length content topic defined in the spec And if we receive the short version of the content topic, transform it at the application level to the long version which will be stored in the DB. If that's the case, then when interacting directly with the DB in tests, we would only need to use the full version. Does it make sense? cc @jm-clius |
At this stage we don't know yet if there will be a gen 1. I wouldn't pad our existing content topics just in case we have this generational use in future.
Actually, the entire generational concept is more to indicate how we could expand number of shards in future and may be marked as not implemented until we do define subsequent generations. |
Sounds good, agree with that approach :)) If that's the case, then can we close this one? or is there anything missing? @AlejandroCabeza We do have to check that content topics in short and long forms map to the same pubsub topic, but I think that would be a separate issue from this one. |
Closing this issue as per the above discussion. Feel free to reopen in case something is missing :)) |
If I understood correctly then these two, |
My understanding is that not at the DB level, but when using autosharding's API they should behave as equals |
Right, then has somebody implemented that and enabled the test? |
I see that there's already tests activated for it and working such as nwaku/tests/node/test_wakunode_sharding.nim Lines 310 to 348 in f5d87c5
Which if I understand correctly, implies that both content topics map to the same shard. Maybe I'm missing something? |
That's a relay-related test. This issue is store-related. |
Yes, but isn't the mapping from content topic to shard the same for all protocols? Same autosharding algorithm. I understood this was the last question remaining, whether autosharding maps both to the same shard and if so we're fine for now (as we decided to not see them as equivalent at the DB level). So currently
|
I can't remember, but there must be a reason I posted an issue specifically referencing an issue with |
I think that the issue here is that the test is adding and querying it at the DB level which is too low of a level. At that level as per the above discussion it's ok to see both content topics as different. As long as autosharding maps them to the same shard (which is not specific to any protocol and we saw there's already tests that assure it), then everything seems to be alright :) |
Problem
The short and full version for content topics with automatic sharding don't retrieve the same messages.
Having two sets of messages, one for
/toychat/2/huilong/proto
and another for/0/toychat/2/huilong/proto
, when making aHistoryQuery
for each of the content topics, each query retrieves their respective set of messages, and not both.Impact
...
To reproduce
/0/toychat/2/huilong/proto
) and another short (/toychat/2/huilong/proto
).ArchiveDriver
and insert the two sets of messages; each of them assigned to one of the content topics.the server.
HistoryQuery
. One both will make a request to the server, one of them to the full content topic, another to the short content topic.You can also check
tests/sharding
branch. Opentests/node/test_wakunode_sharding.nim
and check out thestore (automatic sharding filtering)
case. Keep in mind they are declared asxasyncTest
, so you'll need to update them toasyncTest
for them not to be ignored by the test runner.Expected behavior
Given the two content topics are equivalent, both sets of messages should be retrieved by both queries.
nwaku version/commit hash
wakunode2: v0.27.0-rc.0-11-ge61e4f
branch:
tests/sharding
commit: 82978c5 (might change in the future)
pr: #2603
The text was updated successfully, but these errors were encountered: