-
Notifications
You must be signed in to change notification settings - Fork 26
Conversation
Agreed, let's wait on #47. |
A better idea would be a new state ( |
SGTM
It makes sense, but we only allow one RW file descriptor (and potentially many RO descriptors), so in a way we are centralizing the file state there. |
One of the test cases randomly fails with a 0 being passed to Int63n.
See Jenkins results https://travis-ci.org/ipfs/go-mfs/builds/472151928?utm_source=github_status&utm_medium=notification |
The function seems to panic if it gets an Line 633 in 64e7cdb
Also, |
Yeah that's where I am stuck. Need to figure out why my changes would affect the file creation since almost all of them are concerned only with RW flags for the fd's. Bummer. Will try to dig in a little further. Gotta spend some time looking at the test helper functions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function seems to panic if it gets an
n <= 0
(https://golang.org/pkg/math/rand/#Int63n), are we correctly reporting the created file size?Line 633 in 64e7cdb
s, err := fi.Size()Also,
TestMfsStress
is a heavily concurrent function, so any errors there are normally linked to a possible data race.
What does this method do ? I am completely lost here.
The failure in @schomatis If the proposal makes sense I will create a PR for it and get it into |
That entails that this should also happen in |
#45 is merged now. |
In that case do I need to do anything ? |
No, just rebase to (the new) |
@schomatis Do you think we should get this in even without #47 being merged in since it bypasses the waitPub issue in any case ? |
The only commit remaining from #32 is ipfs/kubo@f4dc9a4 |
Yes, if it makes sense on its own, we can unblock it.
We should definitely add this since it was testing the new modifications (at that time) and it was failing. |
I merged those changes and all the tests pass, but it takes close to 500 seconds to run the 5000 iterations in You think I should bring the iterations down to a 100 (0.063s) or 500 (0.881s) or 1000 (2.710s) vs 5000 (491.51s) maybe ? I will add the commit once I know what to set the value to. |
ouch, that's a lot, yes, let's keep it under 1-2 seconds, it's a bit suspicious that a single Also, your scale doesn't seem very proportionate, 5000 iterations costs 500 seconds, but dropping it to 1000 lowers it to 2.7? and 500 (1/10th of the original) is run in less than a second? All that being said, if the tests are passing we're already on (a very good) track, we'll just have to fine tune some things. I'll give the PR a proper review in the following days. |
@nitishm Not very important, but could you try rebasing this PR onto the current |
Pulled changes from ipfs/kubo#4517, on top of, ipfs#45. Change added to unblock the `waitPub()` call. With the elimination of stateSync cause a `updateChildEntry` to happen for `stateFlushed` as well, causing it to propogate upwards to the parent(s) [fullSync] and force a publish to happen, hence unblocking `waitPub`.
Added a new state for a freshly opened `fileDescriptor`. In `flushUp` only bubble up update if state is either `stateDirty` or `stateCreated`. `stateFlushed` should prevent bubble up.
Add 1 to rand.Intn() to prevent 0 size reader for being created.
During `flushUp()` of an un-flushed fd, be it with freshly created or modified content, always update the file descriptors inode, with the contents of the node.
Pull in commit from go-ipfs commit ipfs/kubo@f4dc9a4 Dropped nloop to 500 (from 1000) in `TestConcurrentWriteAndFlush` to reduce testing time. All unittests pass.
@schomatis I did something. I don't know if I did the right thing, to do the rebase. Does this sound right ? From nitishm/go-mfs repo I did -
Does that sound right ? I dont have too much experience with dealing with forks and keeping them up to date. |
You'd normally want to use the |
So do I need to undo any of this or does it look right to you ? |
76befbb
to
40c7e34
Compare
I managed to undo my last merge (hurray), and to rebased to the upstream/master. But it seems like my branch is already up to date with all the commits (atleast I can find |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Niiiiice. I'll leave the PR open for a couple of days in case @Stebalien wants to take a look at it (since we've been applying his code), particularly TestConcurrentWrites
, since that patch came from a WIP PR that may have been unfinished.
SGTM ! @schomatis Got anything else you want me to look at, apart from the go-ipfs docs ? |
Nothing important, we should prioritize the docs, they are also a great way for you to know what's out there in terms of the code base and to find other components you may be interested in. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
The WIP part was that I couldn't fix ipfs/kubo#4519. |
Great work @nitishm!! 🎉 |
Thanks for all the help @schomatis . I thoroughly appreciate it ! |
Yes, thank you both! |
#32 is partially completed by this PR.
Personally this doesn't seem like the best way to do things, by forcing
updateChildEntry
even onstateFlushed
but currently that is the only way to unblockwaitPub
which is blocking in theFlushPath
call.A better solution will be based on the completion of #47 which should eliminate
waitPub
Fixes #50.
Fixes ipfs/kubo#4514.