[master] d624ddf62 shard director: retire canon_point

Nils Goroll nils.goroll at uplex.de
Tue Jun 9 17:03:07 UTC 2020


commit d624ddf62a0db701d138c9552458013d2dc08b88
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Tue Jun 9 18:04:17 2020 +0200

    shard director: retire canon_point
    
    The first hashcircle point of a backend was saves as canon_point, but
    never used for anything but JSON backend.list output.
    
    I assume no-one needs it. Famous Last Words (tm).

diff --git a/lib/libvmod_directors/shard_cfg.c b/lib/libvmod_directors/shard_cfg.c
index 7567f0050..6276e1728 100644
--- a/lib/libvmod_directors/shard_cfg.c
+++ b/lib/libvmod_directors/shard_cfg.c
@@ -273,9 +273,6 @@ shardcfg_hashcircle(struct sharddir *shardd, VCL_INT replicas)
 			    VRT_HashStrands32(ss);
 			shardd->hashcircle[i * replicas + j].host = i;
 		}
-		/* not used in current interface */
-		shardd->backend[i].canon_point =
-		    shardd->hashcircle[i * replicas].point;
 	}
 	qsort( (void *) shardd->hashcircle, shardd->n_backend * replicas,
 	    sizeof (struct shard_circlepoint), (compar) circlepoint_compare);
@@ -313,7 +310,6 @@ shardcfg_backend_copyin(struct shard_backend *dst,
 	dst->backend = src->backend;
 	dst->ident = src->ident ? strdup(src->ident) : NULL;
 	dst->rampup = src->rampup;
-	dst->canon_point = 0xffffffff;
 }
 
 static int
diff --git a/lib/libvmod_directors/shard_dir.h b/lib/libvmod_directors/shard_dir.h
index 067b4415a..03df1c312 100644
--- a/lib/libvmod_directors/shard_dir.h
+++ b/lib/libvmod_directors/shard_dir.h
@@ -43,7 +43,6 @@ struct shard_backend {
 		void		*freeptr;
 	};
 	VCL_DURATION		rampup;
-	uint32_t		canon_point;
 };
 
 struct vmod_directors_shard_param;
diff --git a/lib/libvmod_directors/vmod_shard.c b/lib/libvmod_directors/vmod_shard.c
index 7c56cedb6..c3ec5d837 100644
--- a/lib/libvmod_directors/vmod_shard.c
+++ b/lib/libvmod_directors/vmod_shard.c
@@ -763,8 +763,6 @@ vmod_shard_list(VRT_CTX, VCL_BACKEND dir, struct vsb *vsb, int pflag, int jflag)
 			    sbe->ident ? sbe->ident : be->vcl_name);
 			VSB_printf(vsb, "\"health\": \"%s\",\n",
 			    h ? "healthy" : "sick");
-			VSB_printf(vsb, "\"canon_point\": %u,\n",
-			    sbe->canon_point);
 			VSB_printf(vsb, "\"rampup\": %f,\n", rampup_p);
 			VSB_printf(vsb, "\"rampup_remaining\": %.3f\n",
 			    rampup_d);


More information about the varnish-commit mailing list