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
68fc5f9a
Commit
68fc5f9a
authored
Mar 03, 2016
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pass the busyobj (if any) when checking health, comment, remove unused function
parent
3002afbf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
26 deletions
+18
-26
vslp_dir.c
src/vslp_dir.c
+18
-25
vslp_dir.h
src/vslp_dir.h
+0
-1
No files found.
src/vslp_dir.c
View file @
68fc5f9a
...
...
@@ -48,11 +48,11 @@
typedef
int
(
*
compar
)(
const
void
*
,
const
void
*
);
struct
vslp_state
{
const
struct
vrt_ctx
*
ctx
;
struct
vslpdir
*
vslpd
;
struct
vbitmap
*
picklist
;
/* start index in the hashcircle for our key */
int
idx
;
const
struct
vrt_ctx
*
ctx
;
};
static
int
...
...
@@ -183,7 +183,7 @@ vslp_choose_next_healthy(struct vslp_state *state, uint32_t n_retry)
be
=
state
->
vslpd
->
backend
[
chosen
];
AN
(
be
);
if
(
be
->
healthy
(
be
,
NULL
,
NULL
))
if
(
be
->
healthy
(
be
,
state
->
ctx
->
bo
,
NULL
))
{
vslp_be_healthy
(
state
,
chosen
);
break
;
...
...
@@ -363,29 +363,22 @@ void vslpdir_expand(struct vslpdir *vslpd, unsigned n)
vslpd
->
l_backend
=
n
;
}
unsigned
vslpdir_any_healthy
(
struct
vslpdir
*
vslpd
)
{
unsigned
retval
=
0
;
VCL_BACKEND
be
;
unsigned
u
;
CHECK_OBJ_NOTNULL
(
vslpd
,
VSLPDIR_MAGIC
);
vslpdir_lock
(
vslpd
);
for
(
u
=
0
;
u
<
vslpd
->
n_backend
;
u
++
)
{
be
=
vslpd
->
backend
[
u
];
CHECK_OBJ_NOTNULL
(
be
,
DIRECTOR_MAGIC
);
if
(
be
->
healthy
(
be
,
NULL
,
NULL
))
{
retval
=
1
;
break
;
}
}
vslpdir_unlock
(
vslpd
);
return
(
retval
);
}
/*
* core function for the director backend method
*
* while other directors return a reference to their own backend object (on
* which varnish will call the resolve method to resolve to a non-director
* backend), this director immediately reolves in the backend method, to make
* the director choice visible in VCL
*
* consequences:
* - we need no own struct director
* - we can only respect a busy object when being called on the backend side,
* which probably is, for all practical purposes, only relevant when the
* saintmode vmod is used
*
* arguments:
*
* hash: position on the ring
* n_retry:
* 0 : choose n-th backend based on number of restarts / retries
...
...
@@ -410,8 +403,8 @@ VCL_BACKEND vslpdir_pick_be(struct vslpdir *vslpd,
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
AN
(
ctx
->
vsl
);
state
.
vslpd
=
vslpd
;
state
.
ctx
=
ctx
;
state
.
vslpd
=
vslpd
;
state
.
picklist
=
vbit_init
(
picklist_spc
,
picklist_sz
);
AN
(
state
.
picklist
);
...
...
src/vslp_dir.h
View file @
68fc5f9a
...
...
@@ -71,6 +71,5 @@ void vslpdir_init_hashcircle(struct vslpdir *vslpd, VCL_INT replicas);
void
vslpdir_lock
(
struct
vslpdir
*
vslpd
);
void
vslpdir_unlock
(
struct
vslpdir
*
vslpd
);
void
vslpdir_expand
(
struct
vslpdir
*
vslpd
,
unsigned
n
);
unsigned
vslpdir_any_healthy
(
struct
vslpdir
*
vslpd
);
VCL_BACKEND
vslpdir_pick_be
(
struct
vslpdir
*
vslpd
,
const
struct
vrt_ctx
*
ctx
,
uint32_t
hash
,
VCL_INT
n_retry
,
VCL_BOOL
altsrv_p
,
VCL_BOOL
healthy
);
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