Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
9997d5ce
Commit
9997d5ce
authored
Feb 09, 2022
by
Nikola Milojevic
Committed by
Marcia Ramos
Feb 09, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update docs for lb workers with deduplication
parent
74f805e6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
27 deletions
+4
-27
doc/development/sidekiq/idempotent_jobs.md
doc/development/sidekiq/idempotent_jobs.md
+0
-24
doc/development/sidekiq/worker_attributes.md
doc/development/sidekiq/worker_attributes.md
+4
-3
No files found.
doc/development/sidekiq/idempotent_jobs.md
View file @
9997d5ce
...
@@ -185,30 +185,6 @@ end
...
@@ -185,30 +185,6 @@ end
Duplicate jobs can happen when the TTL is reached, so make sure you lower this only for jobs
Duplicate jobs can happen when the TTL is reached, so make sure you lower this only for jobs
that can tolerate some duplication.
that can tolerate some duplication.
## Deduplication with load balancing
> [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/6763) in GitLab 14.4.
Jobs that declare either
`:sticky`
or
`:delayed`
data consistency
are eligible for database load-balancing.
In both cases, jobs are
[
scheduled in the future
](
#scheduling-jobs-in-the-future
)
with a short delay (1 second).
This minimizes the chance of replication lag after a write.
If you really want to deduplicate jobs eligible for load balancing,
specify
`including_scheduled: true`
argument when defining deduplication strategy:
```
ruby
class
DelayedIdempotentWorker
include
ApplicationWorker
data_consistency
:delayed
deduplicate
:until_executing
,
including_scheduled:
true
idempotent!
# ...
end
```
### Preserve the latest WAL location for idempotent jobs
### Preserve the latest WAL location for idempotent jobs
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/69372) in GitLab 14.3.
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/69372) in GitLab 14.3.
...
...
doc/development/sidekiq/worker_attributes.md
View file @
9997d5ce
...
@@ -259,10 +259,11 @@ these scenarios, since `:always` should be considered the exception, not the rul
...
@@ -259,10 +259,11 @@ these scenarios, since `:always` should be considered the exception, not the rul
To allow for reads to be served from replicas, we added two additional consistency modes:
`:sticky`
and
`:delayed`
.
To allow for reads to be served from replicas, we added two additional consistency modes:
`:sticky`
and
`:delayed`
.
When you declare either
`:sticky`
or
`:delayed`
consistency, workers become eligible for database
When you declare either
`:sticky`
or
`:delayed`
consistency, workers become eligible for database
load-balancing. In both cases, jobs are enqueued with a short delay.
load-balancing.
This minimizes the likelihood of replication lag after a write.
The difference is in what happens when there is replication lag after the delay:
`sticky`
workers
In both cases, if the replica is not up-to-date and the time from scheduling the job was less than the minimum delay interval,
the jobs sleep up to the minimum delay interval (0.8 seconds). This gives the replication process time to finish.
The difference is in what happens when there is still replication lag after the delay:
`sticky`
workers
switch over to the primary right away, whereas
`delayed`
workers fail fast and are retried once.
switch over to the primary right away, whereas
`delayed`
workers fail fast and are retried once.
If they still encounter replication lag, they also switch to the primary instead.
If they still encounter replication lag, they also switch to the primary instead.
**
If your worker never performs any writes, it is strongly advised to apply one of these consistency settings,
**
If your worker never performs any writes, it is strongly advised to apply one of these consistency settings,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment