Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
51374: sql: add a virtual index on the pg_catalog.pg_type.OID r=rohany a=ekalinin

Fixes #49208

Release note (performance improvement): scans over virtual
table pg_type by OID column have improved performance in common cases.

51484: geomfn: implement validity operators r=rytaft a=otan

Unfortunately we cannot implement ST_IsValidDetail because it returns a
composite type, which we do not yet support.

Resolves #48960
Resolves #48961
Resolves #48963
Resolves #48964

Release note (sql change): Implements ST_IsValid, ST_IsValidReason and
ST_MakeValid operators for geometry types.

51557: roachprod: fix roachprod start behaviour for single node clusters r=rafiss a=irfansharif

Fixes #51532.

This is fallout from #51329, after which we tried using --join flags for
single node clusters (that roachprod uses `start-single-node` for). This
tripped up roachtests like #51532, which are now fixed.

Release note: None.

51558: roachtest: cleanup sqlalchemy roachtest r=rafiss a=irfansharif

Was just in the area investigating something else, cleaned it up a bit.
It's just all code movement.

Release note: None

Co-authored-by: kev <[email protected]>
Co-authored-by: Oliver Tan <[email protected]>
Co-authored-by: irfan sharif <[email protected]>
  • Loading branch information
4 people committed Jul 17, 2020
5 parents 0b627b0 + d85f407 + 45c6cb4 + 8a90d3c + fb0ca82 commit 7cb22cd
Show file tree
Hide file tree
Showing 13 changed files with 843 additions and 210 deletions.
19 changes: 19 additions & 0 deletions docs/generated/sql/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -1114,6 +1114,22 @@ given Geometry.</p>
<p>This function utilizes the GEOS module.</p>
<p>This function variant will attempt to utilize any available geospatial index.</p>
</span></td></tr>
<tr><td><a name="st_isvalid"></a><code>st_isvalid(geometry: geometry) &rarr; <a href="bool.html">bool</a></code></td><td><span class="funcdesc"><p>Returns whether the geometry is valid as defined by the OGC spec.</p>
<p>This function utilizes the GEOS module.</p>
</span></td></tr>
<tr><td><a name="st_isvalid"></a><code>st_isvalid(geometry: geometry, flags: <a href="int.html">int</a>) &rarr; <a href="bool.html">bool</a></code></td><td><span class="funcdesc"><p>Returns whether the geometry is valid.</p>
<p>For flags=0, validity is defined by the OGC spec.</p>
<p>For flags=1, validity considers self-intersecting rings forming holes as valid as per ESRI. This is not valid under OGC and CRDB spatial operations may not operate correctly.</p>
<p>This function utilizes the GEOS module.</p>
</span></td></tr>
<tr><td><a name="st_isvalidreason"></a><code>st_isvalidreason(geometry: geometry) &rarr; <a href="string.html">string</a></code></td><td><span class="funcdesc"><p>Returns a string containing the reason the geometry is invalid along with the point of interest, or “Valid Geometry” if it is valid. Validity is defined by the OGC spec.</p>
<p>This function utilizes the GEOS module.</p>
</span></td></tr>
<tr><td><a name="st_isvalidreason"></a><code>st_isvalidreason(geometry: geometry, flags: <a href="int.html">int</a>) &rarr; <a href="string.html">string</a></code></td><td><span class="funcdesc"><p>Returns the reason the geometry is invalid or “Valid Geometry” if it is valid.</p>
<p>For flags=0, validity is defined by the OGC spec.</p>
<p>For flags=1, validity considers self-intersecting rings forming holes as valid as per ESRI. This is not valid under OGC and CRDB spatial operations may not operate correctly.</p>
<p>This function utilizes the GEOS module.</p>
</span></td></tr>
<tr><td><a name="st_length"></a><code>st_length(geography: geography) &rarr; <a href="float.html">float</a></code></td><td><span class="funcdesc"><p>Returns the length of the given geography in meters. Uses a spheroid to perform the operation.</p>
<p>This function utilizes the GeographicLib library for spheroid calculations.</p>
</span></td></tr>
Expand Down Expand Up @@ -1161,6 +1177,9 @@ given Geometry.</p>
</span></td></tr>
<tr><td><a name="st_makepolygon"></a><code>st_makepolygon(outer: geometry, interior: anyelement[]) &rarr; geometry</code></td><td><span class="funcdesc"><p>Returns a new Polygon with the given outer LineString and interior (hole) LineString(s).</p>
</span></td></tr>
<tr><td><a name="st_makevalid"></a><code>st_makevalid(geometry: geometry) &rarr; geometry</code></td><td><span class="funcdesc"><p>Returns a valid form of the given geometry according to the OGC spec.</p>
<p>This function utilizes the GEOS module.</p>
</span></td></tr>
<tr><td><a name="st_maxdistance"></a><code>st_maxdistance(geometry_a: geometry, geometry_b: geometry) &rarr; <a href="float.html">float</a></code></td><td><span class="funcdesc"><p>Returns the maximum distance across every pair of points comprising the given geometries. Note if the geometries are the same, it will return the maximum distance between the geometry’s vertexes.</p>
</span></td></tr>
<tr><td><a name="st_mlinefromtext"></a><code>st_mlinefromtext(str: <a href="string.html">string</a>, srid: <a href="int.html">int</a>) &rarr; geometry</code></td><td><span class="funcdesc"><p>Returns the Geometry from a WKT or EWKT representation with an SRID. If the shape underneath is not MultiLineString, NULL is returned. If the SRID is present in both the EWKT and the argument, the argument value is used.</p>
Expand Down
32 changes: 19 additions & 13 deletions pkg/cmd/roachprod/install/cockroach.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ func argExists(args []string, target string) int {
func (r Cockroach) Start(c *SyncedCluster, extraArgs []string) {
// Check to see if node 1 was started, indicating the cluster is to be
// bootstrapped.
var bootstrappable bool
var bootstrap bool
for _, i := range c.ServerNodes() {
if i == 1 {
bootstrappable = true
bootstrap = true
break
}
}

if c.Secure && bootstrappable {
if c.Secure && bootstrap {
c.DistributeCerts()
}

Expand Down Expand Up @@ -217,10 +217,22 @@ func (r Cockroach) Start(c *SyncedCluster, extraArgs []string) {
args = append(args, "--locality="+locality)
}
}
// `cockroach start` without `--join` is no longer supported as 20.1.
if nodes[i] != 1 || vers.AtLeast(version.MustParse("v20.1.0")) {
args = append(args, fmt.Sprintf("--join=%s:%d", host1, r.NodePort(c, 1)))

// For a one-node cluster, use `start-single-node` to disable replication.
// For everything else we'll fall back to using `cockroach start`.
var startCmd string
if len(c.VMs) == 1 && vers.AtLeast(version.MustParse("v19.2.0")) {
startCmd = "start-single-node"
bootstrap = false // `cockroach start-single-node` auto-bootstraps, so we skip doing so ourselves.
} else {
startCmd = "start"

// `cockroach start` without `--join` is no longer supported as 20.1.
if nodes[i] != 1 || vers.AtLeast(version.MustParse("v20.1.0")) {
args = append(args, fmt.Sprintf("--join=%s:%d", host1, r.NodePort(c, 1)))
}
}

if advertisePublicIP {
args = append(args, fmt.Sprintf("--advertise-host=%s", c.host(i+1)))
} else if !c.IsLocal() {
Expand Down Expand Up @@ -261,12 +273,6 @@ func (r Cockroach) Start(c *SyncedCluster, extraArgs []string) {
args = append(args, strings.Split(expandedArg, " ")...)
}

// For a one-node cluster, use start-single-node to disable replication.
startCmd := "start"
if len(c.VMs) == 1 && vers.AtLeast(version.MustParse("v19.2.0")) {
startCmd = "start-single-node"
}

binary := cockroachNodeBinary(c, nodes[i])
// NB: this is awkward as when the process fails, the test runner will show an
// unhelpful empty error (since everything has been redirected away). This is
Expand Down Expand Up @@ -300,7 +306,7 @@ func (r Cockroach) Start(c *SyncedCluster, extraArgs []string) {
return nil, nil
})

if !bootstrappable {
if !bootstrap {
return
}

Expand Down
Loading

0 comments on commit 7cb22cd

Please sign in to comment.