-
Notifications
You must be signed in to change notification settings - Fork 117
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
pat: Fix the calculation for the target segment #2104
Conversation
@@ -1036,7 +1036,7 @@ key_put(grn_ctx *ctx, grn_pat *pat, const uint8_t *key, uint32_t len) | |||
return 0; | |||
} | |||
|
|||
ts = (res + len) >> W_OF_KEY_IN_A_SEGMENT; | |||
ts = (res + len - 1) >> W_OF_KEY_IN_A_SEGMENT; |
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.
テストを追加できる?
後で変数名もtail_segment
に変更しよう。
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.
GRN_PAT_SEGMENT_SIZE
ぴったり、-1、+1のデータを登録して、どのセグメントを使っているかのテストを追加しようと思ってるのですが、PATが今使っているセグメントの情報って取得できますか?
object_inspect
とか check
を見ていたのですが、欲しい情報が取得できなさそうに見えました。
そもそものテストの方針が良くない?
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.
total_size
でわからないんだっけ?
ピッタリ使っているならキーサイズと同じサイズがtotal_size
になって、無駄使いしていたらキーサイズよりも大きくならない?
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.
tail_segment
よりend_segment
とかの方がいいかな。
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.
total_size
でわかりました。あざます。
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.
ts
って tail_segment
の略だったのか!気づかなかった…。
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.
変数名の変更は別のPRにします。
# 15 bytes per key. | ||
# 4,194,304 / 15 = 279,620 with a remainder of 4. | ||
# The data is a bit over from the first segment. | ||
#@timeout 30 |
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.
WindowsのCIで失敗しているからもう少し伸ばそうか。
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.
timeoutを増やしつつ、#2090 でも失敗してたのでrebaseした。
When the next length to be added equals `GRN_PAT_SEGMENT_SIZE`, move on to the next segment. But, if the size is the equal, it can be written to the current segment, so it was fixed so that it can be calculated correctly. The io layer allocates an space of `GRN_PAT_SEGMENT_SIZE`.
c2a6ba3
to
49186d0
Compare
rebaseしてみて。 |
あぁ、rebaseしても失敗したのか。 #2090 じゃダメだったかぁ。 |
re-runしてみる。 |
安定しないけどこのテストはパスしている気がするからマージしよう。 |
When the next length to be added equals
GRN_PAT_SEGMENT_SIZE
, move on to the next segment.But, if the size is the equal, it can be written to the current segment, so it was fixed so that it can be calculated correctly.
The
grn_io
layer allocates an space ofGRN_PAT_SEGMENT_SIZE
.