Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
e148a5ef
Unverified
Commit
e148a5ef
authored
Jun 10, 2020
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
flexelinting
parent
72bb92f0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
shard_cfg.c
lib/libvmod_directors/shard_cfg.c
+4
-3
shard_dir.c
lib/libvmod_directors/shard_dir.c
+3
-2
No files found.
lib/libvmod_directors/shard_cfg.c
View file @
e148a5ef
...
@@ -244,8 +244,8 @@ static void
...
@@ -244,8 +244,8 @@ static void
shardcfg_hashcircle
(
struct
sharddir
*
shardd
)
shardcfg_hashcircle
(
struct
sharddir
*
shardd
)
{
{
const
struct
shard_backend
*
backends
,
*
b
;
const
struct
shard_backend
*
backends
,
*
b
;
int
j
,
h
;
int
h
;
uint32_t
i
,
n_points
,
r
,
rmax
;
uint32_t
i
,
j
,
n_points
,
r
,
rmax
;
const
char
*
ident
;
const
char
*
ident
;
const
int
len
=
12
;
// log10(UINT32_MAX) + 2;
const
int
len
=
12
;
// log10(UINT32_MAX) + 2;
char
s
[
len
];
char
s
[
len
];
...
@@ -578,7 +578,8 @@ shardcfg_apply_change(VRT_CTX, struct sharddir *shardd,
...
@@ -578,7 +578,8 @@ shardcfg_apply_change(VRT_CTX, struct sharddir *shardd,
if
(
replicas
*
task
->
weight
>
UINT32_MAX
)
if
(
replicas
*
task
->
weight
>
UINT32_MAX
)
b_replicas
=
UINT32_MAX
;
b_replicas
=
UINT32_MAX
;
else
else
b_replicas
=
replicas
*
task
->
weight
;
b_replicas
=
(
uint32_t
)
// flint
(
replicas
*
task
->
weight
);
shardcfg_backend_add
(
&
re
,
task
->
priv
,
shardcfg_backend_add
(
&
re
,
task
->
priv
,
b_replicas
);
b_replicas
);
...
...
lib/libvmod_directors/shard_dir.c
View file @
e148a5ef
...
@@ -259,7 +259,7 @@ init_state(struct shard_state *state,
...
@@ -259,7 +259,7 @@ init_state(struct shard_state *state,
state
->
ctx
=
ctx
;
state
->
ctx
=
ctx
;
state
->
shardd
=
shardd
;
state
->
shardd
=
shardd
;
state
->
idx
=
-
1
;
state
->
idx
=
UINT32_MAX
;
state
->
picklist
=
picklist
;
state
->
picklist
=
picklist
;
/* healhy and changed only defined for hostid != -1 */
/* healhy and changed only defined for hostid != -1 */
...
@@ -319,8 +319,9 @@ sharddir_pick_be_locked(VRT_CTX, const struct sharddir *shardd, uint32_t key,
...
@@ -319,8 +319,9 @@ sharddir_pick_be_locked(VRT_CTX, const struct sharddir *shardd, uint32_t key,
validate_alt
(
ctx
,
shardd
,
&
alt
);
validate_alt
(
ctx
,
shardd
,
&
alt
);
state
->
idx
=
shard_lookup
(
shardd
,
key
);
state
->
idx
=
shard_lookup
(
shardd
,
key
);
assert
(
state
->
idx
<
UINT32_MAX
);
SHDBG
(
SHDBG_LOOKUP
,
shardd
,
"lookup key %x idx %
d
host %u"
,
SHDBG
(
SHDBG_LOOKUP
,
shardd
,
"lookup key %x idx %
u
host %u"
,
key
,
state
->
idx
,
shardd
->
hashcircle
[
state
->
idx
].
host
);
key
,
state
->
idx
,
shardd
->
hashcircle
[
state
->
idx
].
host
);
if
(
alt
>
0
)
{
if
(
alt
>
0
)
{
...
...
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