Page MenuHomePhabricator

Kick off indexing for File objects on creation
ClosedPublic

Authored by amckinley on Apr 18 2017, 3:24 PM.
Tags
None
Referenced Files
F15477559: D17718.id42614.diff
Mon, Apr 7, 4:14 PM
F15461501: D17718.id42613.diff
Tue, Apr 1, 8:46 AM
F15450068: D17718.id42612.diff
Fri, Mar 28, 1:42 PM
F15445671: D17718.id42614.diff
Thu, Mar 27, 3:23 PM
F15443227: D17718.id42613.diff
Thu, Mar 27, 3:09 AM
F15441762: D17718.id.diff
Wed, Mar 26, 7:46 PM
F15435054: D17718.diff
Tue, Mar 25, 6:39 AM
F15406782: D17718.diff
Tue, Mar 18, 1:51 PM
Subscribers

Details

Summary

Ensures that newly-made File objects get indexed into the new ngrams index. Fixes T8788.

Test Plan
  • uploaded a file with daemons stopped; confirmed no new rows in ngrams table
  • started daemons; confirmed indexing of previously-uploaded files happened
  • uploaded a new file with daemons running; confirmed it got added to the index

Not sure how to test the changes to PhabricatorFileUploadSource->writeChunkedFile() and PhabricatorChunkedFileStorageEngine->allocateChunks(). I spent a few minutes trying to find their callers, but the first looks like it requires a Diffusion repo and the 2nd is only accessible via Conduit. I can test that stuff if necessary, but it's such a small change that I'm not worried about it.

Diff Detail

Repository
rP Phabricator
Branch
T8788 (branched from master)
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 16547
Build 22049: Run Core Tests
Build 22048: arc lint + arc unit

Event Timeline

Not sure how to test the changes to PhabricatorFileUploadSource->writeChunkedFile() and PhabricatorChunkedFileStorageEngine->allocateChunks().

I think it's fine to just assume these work, but I think they can be reached through some of these paths:

  • Use arc upload on a file which is larger than 8MB (actually, I think this doesn't hit either one).
  • View a file which is larger than 8MB in Diffusion.
  • Use FileUpload File with the actual file control to upload a file larger than 8MB.
  • Use the "Upload" icon in a Remarkup textarea to upload a file larger than 8MB.

I'm not sure which of those hit which of the callsites offhand.

The "8MB" stuff is because the chunk engine won't engage for small files: we store small files as a single blob, but break larger files up into a series of 4MB chunks.

This revision is now accepted and ready to land.Apr 18 2017, 3:29 PM
This revision was automatically updated to reflect the committed changes.