[CDRIVER-511] Files written to GridFS must be saved before being read back Created: 23/Jan/15  Updated: 18/Nov/15  Resolved: 01/Oct/15

Status: Closed
Project: C Driver
Component/s: GridFS
Affects Version/s: 1.0.2
Fix Version/s: 1.3.0-beta0

Type: Bug Priority: Major - P3
Reporter: Samantha Ritter (Inactive) Assignee: Kyle Suarez
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to CDRIVER-872 GridFS files can be written to after ... Closed

 Description   

(ported from github)

The c driver's GridFS implementation requires that data be saved after being written. Unsaved data can't be read back.

test_write_seek_read (void)
{
   ...
   mongoc_gridfs_file_writev (file, &iov, 1, 0);
 
// notice we didn't save yet
   mongoc_gridfs_file_seek (file, 0, SEEK_SET);
   r = mongoc_gridfs_file_readv (file, &riov, 1, -1, 0);
// r is correct, but riov points to empty buffer(it points to page->read_buf instead page->buf)
}



 Comments   
Comment by Githook User [ 01/Oct/15 ]

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@10gen.com'}

Message: Merge pull request #279 from ksuarz/CDRIVER-511

CDRIVER-511: Allow interleaving GridFS reads/writes
Branch: 1.3.0-dev
https://github.com/mongodb/mongo-c-driver/commit/c0a7356f5564ecd7d04488dcfd98aa18137296ea

Comment by Githook User [ 01/Oct/15 ]

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@10gen.com'}

Message: Merge pull request #279 from ksuarz/CDRIVER-511

CDRIVER-511: Allow interleaving GridFS reads/writes
Branch: 1.3.0-dev
https://github.com/mongodb/mongo-c-driver/commit/c0a7356f5564ecd7d04488dcfd98aa18137296ea

Comment by Githook User [ 01/Oct/15 ]

Author:

{u'username': u'ksuarz', u'name': u'Kyle Suarez', u'email': u'ksuarz@gmail.com'}

Message: CDRIVER-511 tests don't save between reads/writes

This also makes progress towards fulfilling CDRIVER-872.
Branch: 1.3.0-dev
https://github.com/mongodb/mongo-c-driver/commit/e7a7d9c2bce8f8b968f9ee05c5efc9ea33c37d38

Comment by Githook User [ 01/Oct/15 ]

Author:

{u'username': u'ksuarz', u'name': u'Kyle Suarez', u'email': u'ksuarz@gmail.com'}

Message: CDRIVER-511 invalidate gridfs read buf on write
Branch: 1.3.0-dev
https://github.com/mongodb/mongo-c-driver/commit/a7ea97eb3f64535ef4e6e6f15f8a144d388beaa2

Comment by A. Jesse Jiryu Davis [ 09/Sep/15 ]

Editing myself: we can't break backwards compatibility, we promised that mixed reads & writes are allowed so we have to fix any logic errors related to that. The GridFS spec does not mention mixed reads and writes, so it doesn't prohibit us from continuing to support (and bugfix) that feature.

Comment by A. Jesse Jiryu Davis [ 15/Jul/15 ]

For now, it should be a runtime err to mix reads and writes with the same mongoc_gridfs_file_t. Once we implement the GridFS spec the API will prohibit mixed reads and writes.

Generated at Wed Feb 07 21:09:43 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.