Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-vslp
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
libvmod-vslp
Commits
3002afbf
Commit
3002afbf
authored
Mar 03, 2016
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup, comments
parent
b351e28f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
vslp_dir.c
src/vslp_dir.c
+9
-5
No files found.
src/vslp_dir.c
View file @
3002afbf
...
@@ -50,6 +50,7 @@ typedef int (*compar)( const void*, const void* );
...
@@ -50,6 +50,7 @@ typedef int (*compar)( const void*, const void* );
struct
vslp_state
{
struct
vslp_state
{
struct
vslpdir
*
vslpd
;
struct
vslpdir
*
vslpd
;
struct
vbitmap
*
picklist
;
struct
vbitmap
*
picklist
;
/* start index in the hashcircle for our key */
int
idx
;
int
idx
;
const
struct
vrt_ctx
*
ctx
;
const
struct
vrt_ctx
*
ctx
;
};
};
...
@@ -391,6 +392,9 @@ vslpdir_any_healthy(struct vslpdir *vslpd)
...
@@ -391,6 +392,9 @@ vslpdir_any_healthy(struct vslpdir *vslpd)
* >=1 : choose backend number n_retry (1= first)
* >=1 : choose backend number n_retry (1= first)
* altsrv_p : use altsrv_p to use next backend
* altsrv_p : use altsrv_p to use next backend
* healthy : consider only healthy backends
* healthy : consider only healthy backends
*
* - find best backend based on health state
* - then apply rampup / altsrv_p
*/
*/
VCL_BACKEND
vslpdir_pick_be
(
struct
vslpdir
*
vslpd
,
VCL_BACKEND
vslpdir_pick_be
(
struct
vslpdir
*
vslpd
,
const
struct
vrt_ctx
*
ctx
,
uint32_t
hash
,
const
struct
vrt_ctx
*
ctx
,
uint32_t
hash
,
...
@@ -402,12 +406,15 @@ VCL_BACKEND vslpdir_pick_be(struct vslpdir *vslpd,
...
@@ -402,12 +406,15 @@ VCL_BACKEND vslpdir_pick_be(struct vslpdir *vslpd,
unsigned
picklist_sz
=
VBITMAP_SZ
(
vslpd
->
n_backend
);
unsigned
picklist_sz
=
VBITMAP_SZ
(
vslpd
->
n_backend
);
char
picklist_spc
[
picklist_sz
];
char
picklist_spc
[
picklist_sz
];
state
.
picklist
=
vbit_init
(
picklist_spc
,
picklist_sz
);
AN
(
state
.
picklist
);
CHECK_OBJ_NOTNULL
(
vslpd
,
VSLPDIR_MAGIC
);
CHECK_OBJ_NOTNULL
(
vslpd
,
VSLPDIR_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
AN
(
ctx
->
vsl
);
AN
(
ctx
->
vsl
);
state
.
vslpd
=
vslpd
;
state
.
ctx
=
ctx
;
state
.
picklist
=
vbit_init
(
picklist_spc
,
picklist_sz
);
AN
(
state
.
picklist
);
if
(
altsrv_p
)
if
(
altsrv_p
)
be_choice
=
(
scalbn
(
random
(),
-
31
)
>
vslpd
->
altsrv_p
);
be_choice
=
(
scalbn
(
random
(),
-
31
)
>
vslpd
->
altsrv_p
);
...
@@ -423,9 +430,6 @@ VCL_BACKEND vslpdir_pick_be(struct vslpdir *vslpd,
...
@@ -423,9 +430,6 @@ VCL_BACKEND vslpdir_pick_be(struct vslpdir *vslpd,
n_retry
--
;
n_retry
--
;
}
}
state
.
vslpd
=
vslpd
;
state
.
ctx
=
ctx
;
if
(
vslpd
->
hashcircle
==
NULL
)
if
(
vslpd
->
hashcircle
==
NULL
)
WRONG
(
"Incomplete VSLP hashcircle"
);
WRONG
(
"Incomplete VSLP hashcircle"
);
...
...
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