-
Notifications
You must be signed in to change notification settings - Fork 6
Feature/opensearch output #40
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
base: develop
Are you sure you want to change the base?
Conversation
interfaces/opensearch/export.go
Outdated
|
|
||
| bi := openSearchBulkIndexerImpl{ | ||
| osClient: client, | ||
| queue: make(chan *bulkIndexerItem), |
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.
queueってどこで使ってますか?
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.
すみません、消し忘れだったので remove しました!
interfaces/opensearch/export.go
Outdated
| } | ||
| ) | ||
|
|
||
| func (o *OpenSearchImpl) ExportToOpenSearch(ctx context.Context, cs primitive.M) error { |
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.
ここのbulkってflushにも正常でリターンすると思うんですが、その場合ってsaveTokenまで走りますか?
そうなるとメモリに溜めてる最中にresume-tokenの位置が進んでいくので、仮にためてたものが正常にflushされなかった場合って欠損しませんか?
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.
たしかに flush しなかった時に欠損してしまうので少しロジック調整します
| id, err := json.Marshal(cs["_id"]) | ||
| if err != nil { | ||
| return errors.InternalServerErrorJsonMarshal.Wrap("Failed to marshal change streams json _id parameter.", err) | ||
| return false, errors.InternalServerErrorJsonMarshal.Wrap("Failed to marshal change streams json _id parameter.", err) |
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.
ここ saveRtFlags だから true が正しいのでは?
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.
あ、間違えた、ごめんなさい。
syama666
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.
LGTM
Elasticsearch への output を追加しました。
環境変数 OPENSEARCH_SYNC_ENABLED で、
かを選択できるようにしています。
また、
を環境変数で制御できます。