[JAVA-667] Caching Behavior Inconsistent when Dropping Indexes Created: 15/Oct/12 Updated: 06/Apr/15 Resolved: 06/Apr/15 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Command Operations |
| Affects Version/s: | 2.9.1 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Adam Comerford | Assignee: | Unassigned |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Description |
|
Based on testing, it seems that the caching behavior of the Java driver in terms of the dropped indexes is different based on how the drop of indexes is called. Does NOT remove cached indexes:
DOES remove cached indexes:
This behavior can cause subsequent re-addition of indexes to fail (as a no-op essentially, there is no indication of the fact that the index has not been created) and can cause significant issues when indexes fail to be added. |
| Comments |
| Comment by Jeffrey Yemin [ 06/Apr/15 ] |
|
DBCollection.ensureIndex has been removed in 3.0, along with any associated caching behavior. So closing this as won't fix. |
| Comment by Jeffrey Yemin [ 27/Feb/13 ] |
|
If this is a concern, clients can always use DBCollection.createIndex to bypass the caching layer. |
| Comment by Michael Benoit [ 16/Jan/13 ] |
|
We don't want to make a round-trip to the server to check for index existence, and the built-in caching in the driver takes care of it. The way our application is designed, it might be necessary to call ensureIndex hundreds (or thousands) of times per second. At this rate, that short round-trip will get awfully expensive. You could certainly argue that this is a design flaw in our application – and it's something we should probably revisit – but for now I just need "ensure" that we avoid the extra round-trip. |
| Comment by Jeffrey Yemin [ 15/Jan/13 ] |
|
Hi Mike, In what way are you relying on it? The server already treats an ensureIndex of an existing index as a no-op, so removing the caching from the driver simply means that we incur a short round-trip to the server to check for existence. |
| Comment by Michael Benoit [ 15/Jan/13 ] |
|
jeff.yemin, in this comment on |