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

Fixing that search ThingUpdater could be blocked when waiting for bulk write completions #1340

Conversation

yufei-cai
Copy link
Contributor

@yufei-cai yufei-cai commented Mar 17, 2022

@thjaeckle wrote:

The behavior change added in PR #1320 caused problems when the "bulk write complete" was not received by the ThingUpdater.
In that case it was blocked for 2 minutes, not processing further updates.

The fix removes this "behavior change" and blocking of new WriteModels in ThingUpdater again.

Instead, it applies sharding (based on the thingId hash) creating substreams in the EnforcementFlow.create() with a configured "bulk-shard-count" ensuring that the same things are updated by the same bulkWriter, or at least reducing probability of concurrent modifications in async bulk writes.

Reopened #1335

thjaeckle and others added 19 commits March 9, 2022 16:24
* send where acks are issued
* change "ReceiveTimeout" in ThingUpdater to a separate timer fixing that any consumed message prolonges the timeout of 2 minutes again

Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
…ull`)

Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
…e same thing

* by creating SubSources using "groupBy(bulkWriteSize)" in EnforcementFlow in order to perform updates regarding a certain thingId always from the same "BulkWriter"
* removing behavior changes in ThingUpdater in order to not block it unnecessarily

Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
…axBulkSize" for that

Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
… substreams based on the thingId hash should be started for bulk updates

Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
…reordering.

Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
The config is not needed.

Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
…e diff computation.

Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
…ed method.

Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
@thjaeckle thjaeckle changed the title Bugfix/search updater bulk write completion Fixing that search ThingUpdater could be blocked when waiting for bulk write completions Mar 17, 2022
Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
Signed-off-by: Cai Yufei <yufei.cai@bosch.io>
The test is failing only on Github.

Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
@thjaeckle thjaeckle added this to the 2.4.0 milestone Mar 18, 2022
thjaeckle and others added 4 commits March 18, 2022 10:04
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
yufei-cai and others added 8 commits March 18, 2022 13:29
Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
The test is failing only on Github.

Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
…f Map<ThingId, Metadata>

Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
…arch-index would not process this event

Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
@yufei-cai yufei-cai force-pushed the bugfix/search-updater-bulk-write-completion branch 2 times, most recently from d6a66a2 to 4a98d57 Compare March 21, 2022 09:00
thjaeckle and others added 4 commits March 21, 2022 12:13
…oduced in EnforcementFlow

Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
Copy link
Member

@thjaeckle thjaeckle left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
@yufei-cai yufei-cai merged commit b239200 into eclipse-ditto:master Mar 21, 2022
@yufei-cai yufei-cai deleted the bugfix/search-updater-bulk-write-completion branch March 21, 2022 20:48
This pull request was closed.
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