Skip to content
This repository was archived by the owner on Mar 14, 2019. It is now read-only.
This repository was archived by the owner on Mar 14, 2019. It is now read-only.

[1.2.0] Update the cfs-worker #214

@raix

Description

@raix

The file worker makes sure that we are not storing all uploaded files to all stores at once.

  • We do this by tracking the uploaded files and queue them up in tasks - one task pr. storage adapter.
  • We throttle the worker queue and failed storage attempts are retried later.
  • If a storage adapter wants to synchronize its data with the rest of the storage adapters on a file it simply store the file into Temp storage and the worker will get notified - This action does not involve conflict resolution.

Pull structure https://github.com/CollectionFS/Meteor-cfs-gridfs/issues/4#issuecomment-37139912
WIP https://github.com/CollectionFS/DEPRECATING-cfs-worker/blob/pull-arc/fileWorker.js

Tasks:

  • The temp store can loose the file - We have to accept that as a worker and cancel the task - FS.Tempstore.createWriteStream cannot access temporary filesystem #209
  • The file worker should observe or listen to upload events on the Tempstore Fileworker should observe temp store #186
  • The transformWrite/transformRead should run async New CFS: allow beforeSave to run async #156
  • Use power-queue to handle tasks New CFS: Use PowerQueue for server file worker #126
  • Maybe have an internal worker collection for tracking tasks - could persist a spinal queue for power-queue
  • Worker should be optional
  • Worker should be able to be installed on a separate server and use one or more separate server processes. It should actually probably be a Meteor app as opposed to a Meteor package. (Could potentially even be a nodejs app, but I don't think it matters much.)
  • Worker should have queue/throttle options, and maybe a simple admin UI page to monitor and adjust (which would go along with making it an app.)
  • Does not run within the Meteor app process.
  • Connects to the same MONGO_URL
  • Safe to run multiple instances of the worker app at once for scaling
  • Assume the temp store is using GridFS. Could add support for any accessible SA in the future, such as S3.
  • All dependencies rigged in a cfs imply package (no inter-package dependencies)
  • cfs:worker does not observe any fsCollections directly, it only interacts with the queue
  • ability to scale individual SA store copies
  • control over the job-collection cleanup schedule, default to remove on completion?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions