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

INTERNAL: Remove dummy fetch in the get API #334

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

ing-eoking
Copy link
Collaborator

@ing-eoking ing-eoking commented Jan 3, 2025

๐Ÿ”— Related Issue

โŒจ๏ธ What I did

  • ์ข…๋ฃŒ ์ง€์  ํ™•์ธ์ด ๋น„๊ต์  ์šฉ์ดํ•œ memcached_fetch_result๋ฅผ ํ™œ์šฉํ–ˆ์Šต๋‹ˆ๋‹ค.
    • VALUE๋ฅผ ๊ฐ€์ ธ์˜ค์ง€ ๋ชปํ•œ ๊ฒฝ์šฐ, NULL์ด ๋ฐ˜ํ™˜๋ฉ๋‹ˆ๋‹ค.
  • memcached_fetch ๋‚ด๋ถ€์—์„œ ์ฒ˜๋ฆฌํ•˜๋˜ value_length์™€ flags ์ดˆ๊ธฐํ™” ๋กœ์ง์„ memcached_get_by_key ํ•จ์ˆ˜ ์ดˆ๊ธฐ์— ์ˆ˜ํ–‰ํ•˜๋„๋ก ๋ณ€๊ฒฝํ–ˆ์Šต๋‹ˆ๋‹ค.
  • ํ˜„์žฌ CentOS7 ํ™˜๊ฒฝ์—์„œ ํ…Œ์ŠคํŠธ๋ฅผ ์ง„ํ–‰ํ•˜๋Š” ๊ฒฝ์šฐ, develop ๋ธŒ๋žœ์น˜์—์„œ๋„ ๋™์ผํ•˜๊ฒŒ ์•„๋ž˜์˜ ํ…Œ์ŠคํŠธ๊ฐ€ ์‹คํŒจํ•ฉ๋‹ˆ๋‹ค.
    • ์˜ˆ์ „ mop_upsert API๋ฅผ ๊ฐœ๋ฐœํ•˜๋Š” ๊ณผ์ •์—์„œ ๋ฌธ์ œ๊ฐ€ ์žˆ์—ˆ๋˜ ๊ฒƒ์œผ๋กœ ๋ณด์ด๋ฉฐ, ์›์ธ ๋ถ„์„์ค‘์— ์žˆ์Šต๋‹ˆ๋‹ค.
    • ์ €ํฌ ์žฅ๋น„์— ์„ค์น˜๋œ memcached๊ฐ€ mop upsert๊ฐ€ ์—†๋Š” ๊ตฌ๋ฒ„์ „์ด๋ผ ์ƒ๊ธด ๋ฌธ์ œ์˜€์Šต๋‹ˆ๋‹ค.
tests/mem_functions.cc:11420: in arcus_1_10_map_upsert() Assertation  "rc == MEMCACHED_SUCCESS || rc == MEMCACHED_BUFFERED" failed, hint: CLIENT ERROR
	Testing arcus_1_10_map_upsert					[ failed ]

Copy link
Contributor

@jhpark816 jhpark816 left a comment

Choose a reason for hiding this comment

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

๋ฆฌ๋ทฐ ์™„๋ฃŒ

*value_length= memcached_string_length(&result->value);
if (flags)
*flags= result->item_flags;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

memcached_fetch_result() != NULL ๊ฒฝ์šฐ๊ฐ€ 2ํšŒ ์ด์ƒ ๋ฐœ์ƒํ•˜๋Š” ๊ฒฝ์šฐ๋„ ๊ณ ๋ คํ•˜์‹œ์ฃ .

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ํ•˜๋‚˜์˜ key๋ฅผ ๊ฐ€์ ธ์˜ค๋Š” ์—ฐ์‚ฐ์—์„œ๋Š” ์ผ๋ฐ˜์ ์œผ๋กœ ๊ทธ๋Ÿฐ ์ƒํ™ฉ์ด ๋ฐœ์ƒํ•˜์ง€ ์•Š์„ ๊ฒƒ์œผ๋กœ ์˜ˆ์ƒ๋˜์ง€๋งŒ,
๋งŒ์•ฝ 2ํšŒ ์ด์ƒ ๋ฐœ์ƒํ•œ๋‹ค๋ฉด ํ˜„์žฌ ๊ตฌํ˜„์ฒ˜๋Ÿผ END ์ด์ „์˜ ๊ฐ€์žฅ ๋งˆ์ง€๋ง‰ ๊ฐ’์„ ๋ฐ˜ํ™˜ํ•˜๋Š” ํ˜•ํƒœ๊ฐ€ ๋” ์ ์ ˆํ•  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

if (success_occurred)
{
*error= MEMCACHED_SUCCESS;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

success_occurred ๊ฒฝ์šฐ๋Š” value != NULL ์ƒํƒœ์ž…๋‹ˆ๋‹ค.
success_occurred ๋ณ€์ˆ˜๊ฐ€ ํ•„์š” ์—†์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

๊ทธ๋ฆฌ๊ณ , ์ด๋Ÿฌํ•œ ์ฝ”๋“œ๋Š” value == NULL ๊ฒฝ์šฐ์— ๋Œ€ํ•œ ์ฒ˜๋ฆฌ ์ฝ”๋“œ ๋‹ค์Œ์— ์œ„์น˜ํ•˜๋Š” ๊ฒƒ์ด ์ข‹๊ฒ ์Šต๋‹ˆ๋‹ค.

Copy link
Collaborator Author

@ing-eoking ing-eoking Jan 17, 2025

Choose a reason for hiding this comment

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

value์— ๋นˆ ๋ฌธ์ž์—ด์„ ์ €์žฅํ–ˆ์„ ๊ฒฝ์šฐ, value == NULL์ด ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์šฉ์–ด๋ฅผ success_occurred์—์„œ is_value_fetched๋กœ ๋ณ€๊ฒฝํ–ˆ์Šต๋‹ˆ๋‹ค.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants