Uploaded image for project: 'PHP Legacy Driver'
  1. PHP Legacy Driver
  2. PHP-1228

Couldn't remove chunks for GridFS file

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Won't Fix
    • Affects Version/s: 1.5.5
    • Fix Version/s: None
    • Component/s: pecl-mongo
    • Environment:
      Debian 7.6, Mongo 2.6.4
    • # Replies:
      6
    • Last comment by Customer:
      true
    • Sprint:
      PHP Sprint 15, PHP Sprint 16, PHP Sprint 17

      Description

      Sometimes when removing a gridfs file using the php driver, the chunks of the file remain in the chunks collection. For this reason we get a "E11000 duplicate key error index: ... " error, even though we delete the file just before we insert it. In that case we can't rewrite the same gridfs file anymore except we remove it from the chunks collection manually by the mongo console.

      Example code:

      $sID = sha1($this->iCampaign.'_'.$this->sPlattform);
      $oGrid->remove(array('_id' => $sID));
      $oGrid->storeFile($sID,array(
          '_id'      => $sID,
          'c_id'     => $this->iCampaign,
          'partner'  => $this->sPlattform,
          'charset'  => $aTransferData['encoding'],
          'doctype'  => $aTransferData['doctype'],
          'compress' => $aTransferData['compress']
      ));

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              aahrendt Alex
              Participants:
              Last commenter:
              Alexander Golin
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since reply:
                4 years, 22 weeks ago
                Date of 1st Reply: