Skip to content
This repository has been archived by the owner. It is now read-only.

dont trigger noSpaceLeft on huge shards #753

Merged
merged 1 commit into from Jan 2, 2018

Conversation

@littleskunk
Copy link
Member

commented Nov 23, 2017

@braydonf

This comment has been minimized.

Copy link
Contributor

commented Jan 2, 2018

So without this, I do not think spaceAvailable will ever be set to false, as we're not running runSpaceCheck to start the interval that will check it due to that method currently using too much CPU and memory on large databases.

We are running the connectBridges interval that will update a bridge contact info for a farmer to have spaceAvailable if the values differ (https://github.com/littleskunk/core/blob/644d4af70317eba050e55b751fff074a7866a18e/lib/network/farmer.js#L380-L385).

@littleskunk

This comment has been minimized.

Copy link
Member Author

commented Jan 2, 2018

Can you link that interval? I haven't seen something like that. The connectBridges is called only once on startup as far as I know.

@braydonf

This comment has been minimized.

@littleskunk

This comment has been minimized.

Copy link
Member Author

commented Jan 2, 2018

How about this: https://github.com/Storj/core/blob/9691c6a17991a0487e1069a1000db5035b1c57ba/lib/network/farmer.js#L284-L286

As far as I can see the farmer is already connected with the bridge and will skip every additional call?

@braydonf

This comment has been minimized.

Copy link
Contributor

commented Jan 2, 2018

Ah yeah, that could be it.

@braydonf

This comment has been minimized.

Copy link
Contributor

commented Jan 2, 2018

The check for differences in contact data is after that check in _connectBridge

@braydonf

This comment has been minimized.

Copy link
Contributor

commented Jan 2, 2018

I probably neglected to write an integration test for all those methods being used together, and hence the oversight.

@braydonf

This comment has been minimized.

Copy link
Contributor

commented Jan 2, 2018

Okay, merging this and we can fix updating spaceAvailable in a new PR, and then we can make a release

@braydonf braydonf merged commit c36a174 into storj:master Jan 2, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@braydonf

This comment has been minimized.

Copy link
Contributor

commented Jan 2, 2018

Actually, @littleskunk the connected flag gets set to false when noSpaceLeft is called, which should trigger the check and update: https://github.com/Storj/core/blob/master/lib/network/farmer.js#L365

@braydonf

This comment has been minimized.

Copy link
Contributor

commented Jan 2, 2018

We may just need to fix runSpaceCheck and re-enable that interval.

@braydonf

This comment has been minimized.

Copy link
Contributor

commented Jan 3, 2018

Continuing on this with a new PR #755

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants
You can’t perform that action at this time.