storj-archived / bridge

Deprecated. Access the Storj network via simple REST API.
https://storj.io
GNU Affero General Public License v3.0
77 stars 44 forks source link

SIP9 creates only 1 mirror instead of 5 #595

Closed littleskunk closed 6 years ago

littleskunk commented 6 years ago

Package Versions

Replace the values below using the output from npm list storj-bridge.

{"title":"Storj Bridge",
"version":"8.0.0",
"description":"Access the Storj network using a simple REST API.",
"x-protocol-version":"1.2.0-STAGING",
"x-core-version":"8.7.2"}

Expected Behavior

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

The MIRROR_SUCCESS report should trigger a new mirror creation until 5 mirrors exists.

Actual Behavior

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

The first MIRROR_SUCCESS report exists (triggered by SHARD_UPLOADED) but the bridge did not create any additional mirrors. Even if the second farmer did not respond with a download token the bridge could still ask my farmer. My farmer log

{"level":"info","message":"Shard upload completed hash cd1268b718a47de86c34e2bff4170823fc0bdea6 size 16777216","timestamp":"2018-05-15T07:19:59.823Z"}
[...]
{"level":"info","message":"Mirror download completed hash cd1268b718a47de86c34e2bff4170823fc0bdea6 size 16777216","timestamp":"2018-05-15T07:20:41.329Z"}
{"level":"debug","message":"exchange report submitted: {\"dataHash\":\"cd1268b718a47de86c34e2bff4170823fc0bdea6\",\"token\":\"5a45a900812537b6ab8ca7fd96ae51a96515c4d1\",\"exchangeStart\":1526368806356,\"exchangeEnd\":1526368841329,\"exchangeResultCode\":1000,\"exchangeResultMessage\":\"SHARD_DOWNLOADED\"}","timestamp":"2018-05-15T07:20:42.406Z"}

Mirror creation storage events

{ 
    "_id" : ObjectId("5afa8a241d193b21b19c743c"), 
    "token" : "5a45a900812537b6ab8ca7fd96ae51a96515c4d1", 
    "user" : null, 
    "client" : "bfed6ed8f8351ee64b55ed15c8901ba7a49b284b", 
    "farmer" : "1000051d66af778bebb916fffa2076c9ce944790", 
    "downloadBandwidth" : NumberInt(0), 
    "storage" : NumberInt(16777216), 
    "shardHash" : "cd1268b718a47de86c34e2bff4170823fc0bdea6", 
    "processed" : false, 
    "success" : false, 
    "timestamp" : ISODate("2018-05-15T07:20:04.833+0000"), 
    "__v" : NumberInt(0), 
    "clientReport" : {
        "exchangeStart" : ISODate("2018-05-15T07:20:06.356+0000"), 
        "exchangeEnd" : ISODate("2018-05-15T07:20:41.329+0000"), 
        "exchangeResultCode" : NumberInt(1000), 
        "exchangeResultMessage" : "SHARD_DOWNLOADED"
    }, 
    "farmerReport" : {
        "exchangeStart" : ISODate("2018-05-15T07:20:05.101+0000"), 
        "exchangeEnd" : ISODate("2018-05-15T07:20:46.428+0000"), 
        "exchangeResultCode" : NumberInt(1000), 
        "exchangeResultMessage" : "MIRROR_SUCCESS"
    }
}

Steps to Reproduce

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

  1. Start a SIP9 farmer and connect to the staging bridge.
  2. Wait for a mirror download.
  3. Query the storage event for this shard hash.
littleskunk commented 6 years ago

On my farmer logfile the pattern is clear. My farmer is sending an MIRROR_SUCCESS. That should trigger a new mirror download. The bridge sends me 3 retrieve messages but without creating storage events. Somewhere in that area must be a bug.

RichardLitt commented 6 years ago

👋 Hey! Thanks for this contribution. Apologies for the delay in responding!

We've decided to rearchitect Storj, so that we can scale better. You can read more about this decision here. This means that we are entirely focused on v3 at the moment, in the storj/storj repository. Our white paper for v3 is coming very, very soon - follow along on the blog and in our Rocketchat.

As this repository is part of the v2 network, we're no longer maintaining this repository. I am going to close this for now. If you have any questions, I encourage you to jump on Rocketchat and ask them there. Thanks!