[CDRIVER-765] Seeking issues with GridFS file Created: 28/Jul/15 Updated: 18/Nov/15 Resolved: 23/Sep/15 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | GridFS |
| Affects Version/s: | 1.1.10 |
| Fix Version/s: | 1.3.0-beta0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Jose Battig | Assignee: | Kyle Suarez |
| Resolution: | Done | Votes: | 0 |
| Labels: | Bug, driver, pull-request | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Any |
||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Description |
|
There's two seek related issues with GridFS fixed by Pull Request https://github.com/mongodb/mongo-c-driver/pull/251/files 1. If system tries to fetch a page with _mongoc_gridfs_file_refresh_page() not available in cursor anymore, it will fail doing so because comparison to detect the range of available pages had < and > signs reverse in this code (diff from PR): if (file->cursor &&
2. When reading/writing into GridFSFile, if doing so exactly on blocks matching the chunk size, the proper chunk was not getting flushed to database because the calculation of chunk to flush overflowed into the next chunk because the pos field was pointing to the next byte to be written/read. The other diffs in the Pull Request try to address that issue by keeping track of "how" the pos field was updated: a. By direct seeking Depending on this state, we calculate number of page to flush by subtracting 1 (or not) to current pos field. |
| Comments |
| Comment by Githook User [ 22/Sep/15 ] |
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@emptysquare.net'}Message: Merge pull request #273 from ksuarz/bugfix/flush
|
| Comment by Githook User [ 22/Sep/15 ] |
|
Author: {u'username': u'ksuarz', u'name': u'Kyle Suarez', u'email': u'ksuarz@gmail.com'}Message: Changed file->n to be an int32_t to match the type in the server. Set the file's position and current page to zero on creation. Minor comment fixes. |
| Comment by Githook User [ 22/Sep/15 ] |
|
Author: {u'username': u'ksuarz', u'name': u'Kyle Suarez', u'email': u'ksuarz@gmail.com'}Message: |
| Comment by Githook User [ 22/Sep/15 ] |
|
Author: {u'username': u'ksuarz', u'name': u'Kyle Suarez', u'email': u'ksuarz@gmail.com'}Message: Added a new field to mongoc_gridfs_file_t that keeps track of the file's |
| Comment by Githook User [ 22/Sep/15 ] |
|
Author: {u'username': u'jsbattig', u'name': u'Jose Sebastian Battig', u'email': u'jsbattig@convey.com'}Message: |