Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-cluster
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-cluster
Commits
51723332
Commit
51723332
authored
Mar 19, 2019
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add resolve=CLD
parent
ebfb59a8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
1 deletion
+45
-1
Makefile.am
src/Makefile.am
+1
-0
tbl_resolve.h
src/tbl_resolve.h
+1
-0
vmod_cluster.c
src/vmod_cluster.c
+2
-0
vmod_cluster.vcc
src/vmod_cluster.vcc
+5
-1
cld.vtc
src/vtc/cld.vtc
+36
-0
No files found.
src/Makefile.am
View file @
51723332
...
...
@@ -28,6 +28,7 @@ AM_VTC_LOG_FLAGS = \
TESTS
=
\
vtc/cfg.vtc
\
vtc/cld.vtc
\
vtc/deep.vtc
\
vtc/deep_stk.vtc
\
vtc/direct.vtc
\
...
...
src/tbl_resolve.h
View file @
51723332
VMODENUM
(
LAZY
)
VMODENUM
(
SHALLOW
)
VMODENUM
(
DEEP
)
VMODENUM
(
CLD
)
#undef VMODENUM
src/vmod_cluster.c
View file @
51723332
...
...
@@ -435,6 +435,7 @@ real_resolve(VRT_CTX, VCL_BACKEND r, enum resolve_e resolve)
{
switch
(
resolve
)
{
case
SHALLOW
:
case
CLD
:
return
(
r
);
case
DEEP
:
return
(
VRT_DirectorResolve
(
ctx
,
r
));
...
...
@@ -463,6 +464,7 @@ cluster_resolve(VRT_CTX,
switch
(
resolve
)
{
case
SHALLOW
:
return
(
pr
->
cluster
);
case
CLD
:
case
DEEP
:
return
(
r
);
default:
...
...
src/vmod_cluster.vcc
View file @
51723332
...
...
@@ -187,7 +187,7 @@ Return the current `direct` value as set with :ref:`func_cluster.get_direct`.
See :ref:`meth_ctx` for limitations.
$Method BACKEND .backend(ENUM {LAZY, SHALLOW, DEEP} resolve=LAZY,
$Method BACKEND .backend(ENUM {LAZY, SHALLOW, DEEP
, CLD
} resolve=LAZY,
[ BACKEND deny ], [ BACKEND real ],
[ BOOL uncacheable_direct ])
...
...
@@ -205,6 +205,10 @@ documentation:
`real` backend resolve to. Only differs from ``resolve=SHALLOW`` for
director backends.
* for ``resolve=CLD`` (read "cluster deep") the actual backend as if
`cluster` was selected with ``resolve=DEEP`` and a reference to the
`real` backend otherwise.
The optional `deny`, `real` and `uncacheable_direct` arguments behave
differently depending on context:
...
...
src/vtc/cld.vtc
0 → 100644
View file @
51723332
varnishtest "test resolve=CLD"
varnish v1 -vcl {
import cluster;
import directors;
backend s1 { .host = "${bad_backend}";}
backend s2 { .host = "${bad_backend}";}
backend s3 { .host = "${bad_backend}";}
sub vcl_init {
new rr = directors.round_robin();
rr.add_backend(s1);
rr.add_backend(s2);
new real = directors.round_robin();
real.add_backend(s3);
new cl = cluster.cluster(rr.backend(), deny=s2, real=real.backend());
}
sub vcl_recv {
return (synth(200));
}
sub vcl_synth {
set resp.http.b1 = cl.backend(resolve=CLD);
set resp.http.b2 = cl.backend(resolve=CLD);
}
} -start
client c1 {
txreq
rxresp
expect resp.status == 200
expect resp.http.b1 == s1
expect resp.http.b2 == real
} -run
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