-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Fixes index creation in wrong map-container problem. #7838
Fixes index creation in wrong map-container problem. #7838
Conversation
run-lab-run |
1 similar comment
run-lab-run |
|
run-lab-run |
@ahmetmircik These client test failures will be fixed by #7836 |
1463dec
to
21fe4ea
Compare
@@ -284,6 +286,10 @@ public boolean isInvalidationEnabled() { | |||
public InterceptorRegistry getInterceptorRegistry() { | |||
return interceptorRegistry; | |||
} | |||
|
|||
public boolean canBeRemoved() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a very small thing: something like markForRemoval()
could be better. as a developer I do not expect a method starting with can-
to have a side-effect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, completely removed that method, relying on mapContainers#remove(mapName, mapContainer)
should be sufficient.
…destroy and creation of imap, there is a possibility that there can be more than one map-container referenced by record-stores at the same time. Due to that indexes can be created in an unexpected map-container and this can lead to return less than expected number of results after querying imap
21fe4ea
to
5579cb5
Compare
final PartitionContainer[] containers = partitionContainers; | ||
final Semaphore semaphore = new Semaphore(0); | ||
public void destroyMap(String mapName) { | ||
MapContainer mapContainer = mapContainers.get(mapName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which threads can call this method?
edit: I'll answer this myself. both partition threads & user thread can call this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
user + generic operation
run-lab-run |
verify |
👍 |
1 similar comment
👍 |
Bug:
Upon subsequent destroy and creation of imap, there is a possibility that there can be more than one map-container referenced by different record-stores at the same time. Due to that, indexes can be created in an unexpected map-container and this can lead to return less than expected number of results when we query imap.
Fix:
Moved the removal of mapContainer to partition-thread, by making this, i want to be sure that after map#destroy, there is always a new mapContainer instance referenced from a newly created recordstore and that mapContainer instance is different from the removed one.
Test:
Testing this defect is so hard. I was able to reproduce it with adding some sleeps. But still trying to find a simple test also.