-
Notifications
You must be signed in to change notification settings - Fork 49
INTERNAL: read while PIPE_ERROR received in the pipe operation #839
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
Conversation
|
@uhm0311 ๋จผ์ ๋ฆฌ๋ทฐํ๋ฉด ๋ฉ๋๋ค. |
uhm0311
left a comment
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.
1์ฐจ ์ง๋ฌธ์ ๋๋ค.
src/main/java/net/spy/memcached/protocol/ascii/CollectionPipedInsertOperationImpl.java
Show resolved
Hide resolved
uhm0311
left a comment
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.
2์ฐจ, ๋ฆฌ๋ทฐ ์๊ฒฌ๊ณผ ์ง๋ฌธ์ ๋๋ค.
src/main/java/net/spy/memcached/protocol/ascii/CollectionBulkInsertOperationImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/net/spy/memcached/protocol/ascii/CollectionPipedInsertOperationImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/net/spy/memcached/protocol/ascii/OperationImpl.java
Outdated
Show resolved
Hide resolved
faec8fa to
20cf3d9
Compare
uhm0311
left a comment
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.
3์ฐจ ๋ฆฌ๋ทฐ ์๊ฒฌ์ ๋๋ค.
src/main/java/net/spy/memcached/protocol/ascii/OperationImpl.java
Outdated
Show resolved
Hide resolved
|
@oliviarla @uhm0311 |
5493230 to
466ff60
Compare
|
@uhm0311 @jhpark816 |
00d28cd to
63fac49
Compare
uhm0311
left a comment
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.
4์ฐจ ๋ฆฌ๋ทฐ ์๊ฒฌ์ ๋๋ค.
src/main/java/net/spy/memcached/protocol/ascii/OperationImpl.java
Outdated
Show resolved
Hide resolved
a752f86 to
7bf52e7
Compare
|
@jhpark816 ๋ฆฌ๋ทฐ ๋ถํ๋๋ฆฝ๋๋ค. |
|
@oliviarla ๋ฆฌ๋ทฐ ์งํ ์ค์ ๋๋ค. |
jhpark816
left a comment
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.
์ผ๋ถ ๋ฆฌ๋ทฐ
jhpark816
left a comment
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.
๋ฆฌ๋ทฐ ์๋ฃ,
๋ณต์กํ ์ด์๋ค์.
src/main/java/net/spy/memcached/protocol/ascii/CollectionPipedUpdateOperationImpl.java
Outdated
Show resolved
Hide resolved
|
@jhpark816 @uhm0311
|
๋ฆฌ๋ค์ด๋ ํธํ๋ค๋ ๊ฒ์ด ์ด๋ค ์๋ฏธ์ธ๊ฐ์?
result๊ฐ ์๋ ์ง์ ๋ฐ๋ผ ํ๋จํด์ผ ํ ์ง ? ์ ๋์ ๋๋์ด ๋ญ๋๋ค. |
uhm0311
left a comment
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.
๋ณ๊ฒฝ ๋ด์ญ์ ๋ค ๋ฐ๋ผ๊ฐ์ง ๋ชปํด์ ์ง๋ฌธ ๋จ๊น๋๋ค.
src/main/java/net/spy/memcached/protocol/ascii/CollectionPipedInsertOperationImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/net/spy/memcached/protocol/ascii/CollectionPipedInsertOperationImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/net/spy/memcached/protocol/BaseOperationImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/net/spy/memcached/protocol/ascii/CollectionPipedInsertOperationImpl.java
Outdated
Show resolved
Hide resolved
|
@uhm0311 ๋ฆฌ๋ทฐ ์๋ฃ๋์ จ์๊น์? |
|
์งํ ์ค์ ๋๋ค. |
src/main/java/net/spy/memcached/protocol/ascii/CollectionPipedInsertOperationImpl.java
Outdated
Show resolved
Hide resolved
jhpark816
left a comment
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.
๋ฆฌ๋ทฐ ์๋ฃ
src/main/java/net/spy/memcached/protocol/ascii/CollectionPipedInsertOperationImpl.java
Show resolved
Hide resolved
src/main/java/net/spy/memcached/protocol/ascii/CollectionPipedInsertOperationImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/net/spy/memcached/protocol/ascii/CollectionPipedInsertOperationImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/net/spy/memcached/protocol/ascii/CollectionPipedInsertOperationImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/net/spy/memcached/protocol/ascii/CollectionPipedInsertOperationImpl.java
Show resolved
Hide resolved
jhpark816
left a comment
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.
๋ฆฌ๋ทฐ ์๋ฃ
src/main/java/net/spy/memcached/protocol/BaseOperationImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/net/spy/memcached/protocol/ascii/CollectionPipedInsertOperationImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/net/spy/memcached/protocol/ascii/OperationImpl.java
Outdated
Show resolved
Hide resolved
| protected void handleError(OperationErrorType eType, String line) throws IOException { | ||
| getLogger().error("Error: %s by %s", line, this); | ||
| exception = createException(eType, line); | ||
| if (count == 0 && index == 0) { |
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.
CollectionPipedInsertOperationImpl ํด๋์ค์์
๋ช
์์ ์ผ๋ก index๋ฅผ 0์ผ๋ก ์ด๊ธฐํํด ๋๋ ๊ฒ์ฒ๋ผ
๋ช
์์ ์ผ๋ก count๋ 0์ผ๋ก ์ด๊ธฐํํด ๋๋ฉด ์ข๊ฒ ์ต๋๋ค.
๊ทธ๋ฆฌ๊ณ , count == 0 ์กฐ๊ฑด๋ง ์์ด์ผ ํ๊ณ , index == 0 ์กฐ๊ฑด์ ๋น ์ ธ์ผ ํฉ๋๋ค.
์๋ ๊ฒฝ์ฐ์ index == 0์ด๊ธฐ ๋๋ฌธ์
๋๋ค.
RESPONSE 1
CLIENT_ERROR ...
PIPE_ERROR
๊ทธ๋ฆฌ๊ณ , switchover์ redirectํ๋ ๊ฒฝ์ฐ๋ฅผ ๊ณ ๋ คํ๋ค๋ฉด,
count == 0 ์กฐ๊ฑด๋ง ์์ผ๋ฉด ์ถฉ๋ถํ ์ง ๊ฐ๋จํ ์ค๋ช
ํด ์ฃผ์ธ์.
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.
switchover / redirectํ๋ ๊ฒฝ์ฐ count ๊ฐ์ด ์ด๊ธฐํ๋๋๋ก ์์ ํ์ต๋๋ค. (count ๊ฐ์ ํ์ฌ ์ฌ์ฉํ๊ณ ์์ง ์๊ธฐ ๋๋ฌธ์ ์ต์ RESPONSE <count> ์ ๋ณด๋ฅผ ์ ์ฅํด๋๋ ์ฉ๋๋ก๋ง ์ฌ์ฉํด๋ ๋ฉ๋๋ค.)
์ด๋ฅผ ํตํด ์ฒซ ๋ฒ์งธ ์๋ต์ผ๋ก ERROR๊ฐ ์ฌ ๊ฒฝ์ฐ ๋ฐ๋ก ์์ธ๋ฅผ ๋์ง๊ณ , RESPONSE ์ดํ์ ERROR๊ฐ ์ฌ ๊ฒฝ์ฐ PIPE_ERROR๋ฅผ ์ฝ๋๋ก ํฉ๋๋ค.
|
๋ฆฌ๋ทฐ ๋ชจ๋ ๋ฐ์ํ์ต๋๋ค. |
src/main/java/net/spy/memcached/protocol/ascii/CollectionPipedInsertOperationImpl.java
Show resolved
Hide resolved
jhpark816
left a comment
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.
๋ฆฌ๋ทฐ ์๋ฃ
| import net.spy.memcached.ops.OperationType; | ||
| import net.spy.memcached.ops.StatusCode; | ||
|
|
||
| import static net.spy.memcached.ops.OperationErrorType.CLIENT; |
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.
์ง๋ฌธ์ ๋๋ค.
import static์์ static์ ์ด๋ค ์๋ฏธ๊ฐ ๋๋์?- ๊ธฐ์กด ์ฝ๋์์๋ CLIENT๊ฐ ์ฌ์ฉ๋๊ณ ์์ต๋๋ค. ์ด๋ฏธ ๊ด๋ จ๋ import๊ฐ ์กด์ฌํ์ง ์๋ ์ง ?
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.
static import๋ฅผ ํ๊ฒ ๋๋ฉด ํด๋น ๋ณ์๋ ์์๋ฅผ ์ฌ์ฉํ ๋ ์ ์๋ ํด๋์ค ์ด๋ฆ์ ๋ช
์ํ์ง ์๊ณ ์ฌ์ฉํ ์ ์์ต๋๋ค.
์๋ฅผ ๋ค์ด ์ผ๋ฐ import ์์๋ OperationErrorType.CLIENT๋ก ์ฌ์ฉํด์ผ ํ์ง๋ง, static import ์์๋ CLIENT๋ก ์ฌ์ฉํ ์ ์๋๋ฐ, ๊ธฐ์กด์๋ switch๋ฌธ์ ์ฌ์ฉํด์ static importํ ํ์๊ฐ ์์์ต๋๋ค.
๋ค๋ง CLIENT๋ง ์ฌ์ฉํ๋ ๊ฒ๋ณด๋จ OperationErrorType.CLIENT ์ฌ์ฉํ๋ ๊ฒ์ด ๋ ์ดํด๊ฐ ์ฌ์ธ ๊ฒ ๊ฐ์ static import๋ฅผ ์ ๊ฑฐํ์ต๋๋ค.
| if (hasSwitchedOver(line)) { | ||
| this.insert.setNextOpIndex(index); | ||
| prepareSwitchover(line); | ||
| count = 0; |
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.
switchover ๊ฒฝ์ฐ๋ฅผ ์๋ก ๋ค๋ฉด,
์ด๋ฏธ ์ผ๋ถ๊ฐ ์ํ๋ ์ํ์์ ๋๋จธ์ง๋ฅผ switchoverํ ํ์ ์ํํ๋ฉด,
๊ทธ ์ดํ์ ๊ฒฐ๊ณผ๋ ์์ ๊ฒฐ๊ณผ๋ก ์ฒ๋ฆฌํด์ผ ํ ๊ฒ ๊ฐ์ต๋๋ค.
NOT_MY_KEY ๊ฒฝ์ฐ๋ ํจ๊ป ๊ฒํ ๋ฐ๋๋๋ค.
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.
switchover, redirect ๋ก ์ธํด ์๋ก์ด ๋ณ๋ ์์ฒญ์ ๋ณด๋ธ ํ ์๋ต์ ๋ฐ์์ ๋, RESPONSE๊ฐ ์ฌ ์๋ ์๊ณ ํ๋์ ERROR ๋ผ์ธ์ด ์ฌ ์๋ ์์ต๋๋ค.
์ด ๋ RESPONSE๊ฐ ์์ ๋์๋ง ์์ธ๋ฅผ ๋์ง์ง ์๋๋ก ํ์ฌ PIPE_ERROR๊น์ง ์ฝ๋๋ก ํฉ๋๋ค.
|
@jhpark816 |
๐ Related Issue
โจ๏ธ What I did
PIPE_ERROR๋ฅผ ๋๊น์ง ์ฝ๋๋ก ๋ณ๊ฒฝํ๋ค.PIPE_ERROR๋ฅผ ์ฝ์ง ์์๋ค.PIPE_ERROR๋ฅผ ์ฝ๋๋ก ๋ณ๊ฒฝ๋ง ํด๋๊ณ , ์ํ๋์ง ์์ ์ฐ์ฐ์ ๋ํ gotStatus() ํธ์ถ์ INTERNAL: make piped insert operations process synchronouslyย #795 ์ ์ถ๊ฐํ๋๋ก ํ๋ค.