storj-archived / core

Deprecated. Implementation of the Storj v2 protocol for Node.js.
https://storj.io
Other
396 stars 88 forks source link

Farmer permanent switch to noSpaceLeft #752

Closed littleskunk closed 6 years ago

littleskunk commented 6 years ago

Package Versions

Replace the values below using the output from npm list storj. Use npm list -g storj if installed globally.

/usr/local/lib
└─┬ storjshare-daemon@5.2.0
  └── storj-lib@8.4.2

Replace the values below using the output from node --version.

v8.9.1

Expected Behavior

Please describe the program's expected behavior. Include an example of your usage code in the back ticks below if applicable.

Don't send an ALLOC response if the shard is to big. Send an ALLOC response on the next smaller shard.

Actual Behavior

Please describe the program's actual behavior. Please include any stack traces or log output in the back ticks below.

If the shard is bigger than the free disk space the farmer will switch to noSpaceLeft and stop responding to any shards. Only a farmer reboot will fix this.

Farmer switch to noSpaceLeft on receiving a 1.5TB shard ALLOC.

{"level":"info","message":"handling alloc request from fac20825fdd5e7ddc21a797ef5951c2e13250087 hash a5a87af400ca493f332e86c09020bdf1b0af4872 size 1677721600000","timestamp":"2017-11-22T18:58:19.980Z"}
{"level":"debug","message":"contract is associated with connected bridge: true","timestamp":"2017-11-22T18:58:19.981Z"}
{"level":"debug","message":"active transfers 0 is less than offerBackoffLimit 4: true","timestamp":"2017-11-22T18:58:19.981Z"}
{"level":"warn","message":"disk space is at maximum capacity","timestamp":"2017-11-22T18:58:19.982Z"}
{"level":"debug","message":"negotiator returned: false","timestamp":"2017-11-22T18:58:19.982Z"}
{"level":"debug","message":"max KFS bucket size 4294697988, used 1335389105, free 2959308883, shard size 1677721600000","timestamp":"2017-11-22T18:58:19.983Z"}
{"level":"debug","message":"we have enough free space: false","timestamp":"2017-11-22T18:58:19.983Z"}
{"level":"debug","message":"not sending an offer for the contract","timestamp":"2017-11-22T18:58:19.983Z"}

Farmer stoped responding.

{"level":"debug","message":"No space available to accept offer","timestamp":"2017-11-22T19:00:50.509Z"}
{"level":"debug","message":"No space available to accept offer","timestamp":"2017-11-22T19:01:55.186Z"}
{"level":"debug","message":"No space available to accept offer","timestamp":"2017-11-22T19:02:08.012Z"}
{"level":"debug","message":"No space available to accept offer","timestamp":"2017-11-22T19:05:49.193Z"}
{"level":"debug","message":"No space available to accept offer","timestamp":"2017-11-22T19:08:18.748Z"}
{"level":"debug","message":"No space available to accept offer","timestamp":"2017-11-22T19:10:07.813Z"}

850GB free disk space.

root@storage:~# df -h /home/storj/storjdata/
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 1.2T 317G 846G 28% /

Steps to Reproduce

Please include the steps the reproduce the issue, numbered below. Include as much detail as possible.

  1. Upload a few very big shards.
  2. Grep logfile for disk space is at maximum capacity
johnbridge180 commented 6 years ago

A temporary fix could be to remove contract opcodes starting with 0f03 (opcodes allowing for large shard sizes) from your node's opcode subscriptions in the config.

littleskunk commented 6 years ago

No that is not going to work. Opcodes are not used at the moment. You will still run into this issue.

AlexeyALeonov commented 6 years ago

"maxshardsize": "31GB" will work.