Skip to content
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

rgw: loadgen fix generate random object name rgw crash issue #18536

Merged
merged 1 commit into from Nov 3, 2017

Conversation

ZVampirEM77
Copy link
Contributor

@ZVampirEM77 ZVampirEM77 commented Oct 25, 2017

@theanalyst
Copy link
Member

can you explain the crash you're seeing?

@ZVampirEM77
Copy link
Contributor Author

@theanalyst The definition of gen_rand_alphanumeric is
int gen_rand_alphanumeric(CephContext *cct, char *dest, int size);,
cct->random()->get_bytes(dest, size); will be called in gen_rand_alphanumeric
in lastest master branch. If calling gen_rand_alphanumeric with cct = NULL as RGWLoadGenProcess::run() doing before, the rgw will crash.

Actually, I do not verify whether rgw will crash or not during using loadgen with generating random object ID. But I have met the rgw crash issue during PutLC without ID tag and I have
fix the issue in my another PR #18534. I think it is a same issue.

@theanalyst
Copy link
Member

Ah now I understand, there was a PR that went in recently that requires ctx to be a part of gen_random_bytes, this looks right, but I'm not familiar with the loadgen interface

@@ -60,7 +60,7 @@ void RGWLoadGenProcess::run()

for (i = 0; i < num_objs; i++) {
char buf[16 + 1];
gen_rand_alphanumeric(NULL, buf, sizeof(buf));
gen_rand_alphanumeric(cct, buf, sizeof(buf));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's a call to append_rand_alpha(NULL, bucket, bucket, 16); above that needs a cct also

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cbodley Done~

When generating random bucket name and object name during
loadgen processing, RGW will crash. The reason is calling
"gen_rand_alphanumeric" with "cct = NULL".

Fixes: http://tracker.ceph.com/issues/22006

Signed-off-by: Enming Zhang <enming.zhang@umcloud.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants