-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix/TestEvacuateShard
test
#2868
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ func newEngineEvacuate(t *testing.T, shardNum int, objPerShard int) (*StorageEng | |
|
||
e := New( | ||
WithLogger(zaptest.NewLogger(t)), | ||
WithShardPoolSize(1)) | ||
WithShardPoolSize(uint32(objPerShard))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in general, doubtful fix to me possibly hiding buggy implementation or test There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
why? this is literally the problem, i proofed it locally, required 100k+ test runs. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in other words, 1-sized pool cannot guarantee that an object will be put if you want to put 2+ objects. on a few-core machine, it is more critical, on my notebook it is like ~ 0.003%. but an evacuate test should not suffer because of the put problem IMO, it should test evacuation logic and it cannot, because objects are duplicated and go to unexpected shards There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We're testing evacuation here, so shard behavior details are not really relevant (subject to another bug). |
||
|
||
ids := make([]*shard.ID, shardNum) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -114,6 +114,11 @@ | |
|
||
exists, err := sh.Exists(existPrm) | ||
if err != nil { | ||
e.log.Warn("object put: check object existence", | ||
zap.Stringer("addr", addr), | ||
zap.Stringer("shard", sh.ID()), | ||
zap.Error(err)) | ||
|
||
if shard.IsErrObjectExpired(err) { | ||
// object is already found but | ||
// expired => do nothing with it | ||
|
@@ -138,6 +143,10 @@ | |
} | ||
} | ||
|
||
e.log.Debug("object put: object already exists", | ||
zap.Stringer("shard", sh.ID()), | ||
zap.Stringer("addr", addr)) | ||
|
||
return | ||
} | ||
|
||
|
@@ -163,6 +172,7 @@ | |
|
||
putSuccess = true | ||
}); err != nil { | ||
e.log.Warn("object put: pool task submitting", zap.Error(err)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. how this affects the system and/or what's the admin's reaction to this message? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. load to this shard currently is bigger than it can handle. also, we have a system that says where to put an object but now (this line) it is not gonna work: an object goes to another shard (we had (have?) bugs that relate such cases). in fact, it always bothered me that object put was always kinda random, you never know from logs if this placement is ok or a "bad" shard was taken as a best-effort There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this PR (and the issue) is a real example BTW. if i had this log, i wouldn't have had to run this test so many times trying to understand what was happening, it would have taken 1 min looking at logs |
||
close(exitCh) | ||
} | ||
|
||
|
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.
if last shard failed there wont be more
trying
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.
not a problem to me, classic iteration: "try another shard; shard list is over; i finished cycle"
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.
what exactly would you expect here?