Skip to content

Commit

Permalink
Merge branch 'master' into 1192
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkingrei committed Oct 8, 2022
2 parents d448eb2 + 543417b commit fc4dc4f
Show file tree
Hide file tree
Showing 24 changed files with 247 additions and 105 deletions.
3 changes: 2 additions & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
startup --host_jvm_args=-Xmx8g
startup --host_jvm_args=-Xmx6g
startup --unlimit_coredumps

run:ci --color=yes

build --announce_rc
build --experimental_guard_against_concurrent_changes
build --experimental_remote_merkle_tree_cache
build --java_language_version=17
build --java_runtime_version=17
Expand Down
20 changes: 10 additions & 10 deletions DEPS.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2316,8 +2316,8 @@ def go_deps():
name = "com_github_mattn_go_runewidth",
build_file_proto_mode = "disable",
importpath = "github.com/mattn/go-runewidth",
sum = "h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU=",
version = "v0.0.13",
sum = "h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU=",
version = "v0.0.14",
)
go_repository(
name = "com_github_mattn_goveralls",
Expand Down Expand Up @@ -2375,8 +2375,8 @@ def go_deps():
name = "com_github_mgechev_revive",
build_file_proto_mode = "disable",
importpath = "github.com/mgechev/revive",
sum = "h1:a+itKsYpxka50MyaWQW1XCZ1vwfgjzVy/OzZ7DC/4+U=",
version = "v1.2.4-0.20220827111817-553604eaced5",
sum = "h1:+2Hd/S8oO2H0Ikq2+egtNwQsVhAeELHjxjIUFX5ajLI=",
version = "v1.2.4",
)

go_repository(
Expand Down Expand Up @@ -2993,8 +2993,8 @@ def go_deps():
patches = [
"//build/patches:com_github_rivo_uniseg.patch",
],
sum = "h1:3Z3Eu6FGHZWSfNKJTOUiPatWwfc7DzJRU04jFUqJODw=",
version = "v0.3.4",
sum = "h1:YwD0ulJSJytLpiaWua0sBDusfsCZohxjxzVTYjwxfV8=",
version = "v0.4.2",
)
go_repository(
name = "com_github_rlmcpherson_s3gof3r",
Expand Down Expand Up @@ -3422,8 +3422,8 @@ def go_deps():
name = "com_github_tikv_client_go_v2",
build_file_proto_mode = "disable_global",
importpath = "github.com/tikv/client-go/v2",
sum = "h1:GJNu6XDT8W2Oahh+w/fhb37PNhFr4EZjdehIklZnhU4=",
version = "v2.0.1-0.20220921101651-ce9203ef66e9",
sum = "h1:TxDSQAmtGdE34BvOaYF35mRrAXePeZEq8quvuAwrKsI=",
version = "v2.0.1-0.20220923061703-33efe476e022",
)
go_repository(
name = "com_github_tikv_pd_client",
Expand Down Expand Up @@ -4321,8 +4321,8 @@ def go_deps():
name = "org_golang_x_sys",
build_file_proto_mode = "disable_global",
importpath = "golang.org/x/sys",
sum = "h1:wM1k/lXfpc5HdkJJyW9GELpd8ERGdnh8sMGL6Gzq3Ho=",
version = "v0.0.0-20220909162455-aba9fc2a8ff2",
sum = "h1:BkDtF2Ih9xZ7le9ndzTA7KJow28VbQW3odyk/8drmuI=",
version = "v0.0.0-20220928140112-f11e5e49a4ec",
)
go_repository(
name = "org_golang_x_term",
Expand Down
Empty file.
1 change: 1 addition & 0 deletions br/pkg/lightning/backend/kv/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ go_test(
"sql2kv_test.go",
],
flaky = True,
race = "on",
deps = [
":kv",
"//br/pkg/lightning/common",
Expand Down
1 change: 1 addition & 0 deletions br/pkg/lightning/checkpoints/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ go_test(
],
embed = [":checkpoints"],
flaky = True,
race = "on",
deps = [
"//br/pkg/lightning/checkpoints/checkpointspb",
"//br/pkg/lightning/config",
Expand Down
1 change: 1 addition & 0 deletions br/pkg/rtree/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ go_test(
"rtree_test.go",
],
flaky = True,
race = "on",
deps = [
":rtree",
"//testkit/testsetup",
Expand Down
147 changes: 82 additions & 65 deletions build/patches/com_github_rivo_uniseg.patch
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
From 5097c14ae5e40af636fc3bd353edd64ca1f91713 Mon Sep 17 00:00:00 2001
From 1492043a155839cb863210d4f564be3fa640c0d9 Mon Sep 17 00:00:00 2001
From: Weizhen Wang <wangweizhen@pingcap.com>
Date: Mon, 29 Aug 2022 18:15:12 +0800
Subject: [PATCH] *: update dep
Date: Sat, 8 Oct 2022 11:41:06 +0800
Subject: [PATCH] update

Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
---
BUILD.bazel | 26 +++++
BUILD.bazel | 27 +++++
WORKSPACE | 2 +
gen_breaktest.go | 213 ----------------------------------------
gen_properties.go | 240 ----------------------------------------------
4 files changed, 28 insertions(+), 453 deletions(-)
gen_breaktest.go | 213 --------------------------------------
gen_properties.go | 256 ----------------------------------------------
4 files changed, 29 insertions(+), 469 deletions(-)
create mode 100644 BUILD.bazel
create mode 100644 WORKSPACE
delete mode 100644 gen_breaktest.go
delete mode 100644 gen_properties.go

diff --git a/BUILD.bazel b/BUILD.bazel
new file mode 100644
index 0000000..c6423e8
index 0000000..a1e5c89
--- /dev/null
+++ b/BUILD.bazel
@@ -0,0 +1,26 @@
@@ -0,0 +1,27 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+ name = "uniseg",
+ srcs = [
+ "doc.go",
+ "eastasianwidth.go",
+ "emojipresentation.go",
+ "grapheme.go",
+ "graphemeproperties.go",
+ "graphemerules.go",
Expand All @@ -39,14 +40,14 @@ index 0000000..c6423e8
+ "sentenceproperties.go",
+ "sentencerules.go",
+ "step.go",
+ "width.go",
+ "word.go",
+ "wordproperties.go",
+ "wordrules.go",
+ ],
+ importpath = "github.com/rivo/uniseg",
+ visibility = ["//visibility:public"],
+)
+
diff --git a/WORKSPACE b/WORKSPACE
new file mode 100644
index 0000000..d596273
Expand Down Expand Up @@ -276,28 +277,31 @@ index e613c4c..0000000
-}
diff --git a/gen_properties.go b/gen_properties.go
deleted file mode 100644
index 6451270..0000000
index 999d5ef..0000000
--- a/gen_properties.go
+++ /dev/null
@@ -1,240 +0,0 @@
@@ -1,256 +0,0 @@
-//go:build generate
-
-// This program generates a property file in Go file from Unicode Character
-// Database auxiliary data files. The command line arguments are as follows:
-//
-// 1. The name of the Unicode data file (just the filename, without extension).
-// 2. The name of the locally generated Go file.
-// 3. The name of the slice mapping code points to properties.
-// 4. The name of the generator, for logging purposes.
-// 5. (Optional) Flags, comma-separated. The following flags are available:
-// - "emojis": include emoji properties (Extended Pictographic only).
-// - "gencat": include general category properties.
-// 1. The name of the Unicode data file (just the filename, without extension).
-// Can be "-" (to skip) if the emoji flag is included.
-// 2. The name of the locally generated Go file.
-// 3. The name of the slice mapping code points to properties.
-// 4. The name of the generator, for logging purposes.
-// 5. (Optional) Flags, comma-separated. The following flags are available:
-// - "emojis=<property>": include the specified emoji properties (e.g.
-// "Extended_Pictographic").
-// - "gencat": include general category properties.
-//
-//go:generate go run gen_properties.go auxiliary/GraphemeBreakProperty graphemeproperties.go graphemeCodePoints graphemes emojis
-//go:generate go run gen_properties.go auxiliary/WordBreakProperty wordproperties.go workBreakCodePoints words emojis
-//go:generate go run gen_properties.go auxiliary/GraphemeBreakProperty graphemeproperties.go graphemeCodePoints graphemes emojis=Extended_Pictographic
-//go:generate go run gen_properties.go auxiliary/WordBreakProperty wordproperties.go workBreakCodePoints words emojis=Extended_Pictographic
-//go:generate go run gen_properties.go auxiliary/SentenceBreakProperty sentenceproperties.go sentenceBreakCodePoints sentences
-//go:generate go run gen_properties.go LineBreak lineproperties.go lineBreakCodePoints lines gencat
-//go:generate go run gen_properties.go EastAsianWidth eastasianwidth.go eastAsianWidth eastasianwidth
-//go:generate go run gen_properties.go - emojipresentation.go emojiPresentation emojipresentation emojis=Emoji_Presentation
-package main
-
-import (
Expand All @@ -320,8 +324,8 @@ index 6451270..0000000
-// We want to test against a specific version rather than the latest. When the
-// package is upgraded to a new version, change these to generate new tests.
-const (
- gbpURL = `https://www.unicode.org/Public/14.0.0/ucd/%s.txt`
- emojiURL = `https://unicode.org/Public/14.0.0/ucd/emoji/emoji-data.txt`
- propertyURL = `https://www.unicode.org/Public/14.0.0/ucd/%s.txt`
- emojiURL = `https://unicode.org/Public/14.0.0/ucd/emoji/emoji-data.txt`
-)
-
-// The regular expression for a line containing a code point range property.
Expand All @@ -337,20 +341,25 @@ index 6451270..0000000
- log.SetFlags(0)
-
- // Parse flags.
- flags := make(map[string]struct{})
- flags := make(map[string]string)
- if len(os.Args) >= 6 {
- for _, flag := range strings.Split(os.Args[5], ",") {
- flags[flag] = struct{}{}
- flagFields := strings.Split(flag, "=")
- if len(flagFields) == 1 {
- flags[flagFields[0]] = "yes"
- } else {
- flags[flagFields[0]] = flagFields[1]
- }
- }
- }
-
- // Parse the text file and generate Go source code from it.
- var emojis string
- if _, ok := flags["emojis"]; ok {
- emojis = emojiURL
- }
- _, includeGeneralCategory := flags["gencat"]
- src, err := parse(fmt.Sprintf(gbpURL, os.Args[1]), emojis, includeGeneralCategory)
- var mainURL string
- if os.Args[1] != "-" {
- mainURL = fmt.Sprintf(propertyURL, os.Args[1])
- }
- src, err := parse(mainURL, flags["emojis"], includeGeneralCategory)
- if err != nil {
- log.Fatal(err)
- }
Expand All @@ -370,65 +379,73 @@ index 6451270..0000000
-
-// parse parses the Unicode Properties text files located at the given URLs and
-// returns their equivalent Go source code to be used in the uniseg package. If
-// "emojiURL" is an empty string, no emoji code points will be included. If
-// "emojiProperty" is not an empty string, emoji code points for that emoji
-// property (e.g. "Extended_Pictographic") will be included. In those cases, you
-// may pass an empty "propertyURL" to skip parsing the main properties file. If
-// "includeGeneralCategory" is true, the Unicode General Category property will
-// be extracted from the comments and included in the output.
-func parse(gbpURL, emojiURL string, includeGeneralCategory bool) (string, error) {
-func parse(propertyURL, emojiProperty string, includeGeneralCategory bool) (string, error) {
- if propertyURL == "" && emojiProperty == "" {
- return "", errors.New("no properties to parse")
- }
-
- // Temporary buffer to hold properties.
- var properties [][4]string
-
- // Open the first URL.
- log.Printf("Parsing %s", gbpURL)
- res, err := http.Get(gbpURL)
- if err != nil {
- return "", err
- }
- in1 := res.Body
- defer in1.Close()
- if propertyURL != "" {
- log.Printf("Parsing %s", propertyURL)
- res, err := http.Get(propertyURL)
- if err != nil {
- return "", err
- }
- in1 := res.Body
- defer in1.Close()
-
- // Parse it.
- scanner := bufio.NewScanner(in1)
- num := 0
- for scanner.Scan() {
- num++
- line := strings.TrimSpace(scanner.Text())
- // Parse it.
- scanner := bufio.NewScanner(in1)
- num := 0
- for scanner.Scan() {
- num++
- line := strings.TrimSpace(scanner.Text())
-
- // Skip comments and empty lines.
- if strings.HasPrefix(line, "#") || line == "" {
- continue
- }
- // Skip comments and empty lines.
- if strings.HasPrefix(line, "#") || line == "" {
- continue
- }
-
- // Everything else must be a code point range, a property and a comment.
- from, to, property, comment, err := parseProperty(line)
- if err != nil {
- return "", fmt.Errorf("%s line %d: %v", os.Args[4], num, err)
- // Everything else must be a code point range, a property and a comment.
- from, to, property, comment, err := parseProperty(line)
- if err != nil {
- return "", fmt.Errorf("%s line %d: %v", os.Args[4], num, err)
- }
- properties = append(properties, [4]string{from, to, property, comment})
- }
- if err := scanner.Err(); err != nil {
- return "", err
- }
- properties = append(properties, [4]string{from, to, property, comment})
- }
- if err := scanner.Err(); err != nil {
- return "", err
- }
-
- // Open the second URL.
- if emojiURL != "" {
- if emojiProperty != "" {
- log.Printf("Parsing %s", emojiURL)
- res, err = http.Get(emojiURL)
- res, err := http.Get(emojiURL)
- if err != nil {
- return "", err
- }
- in2 := res.Body
- defer in2.Close()
-
- // Parse it.
- scanner = bufio.NewScanner(in2)
- num = 0
- scanner := bufio.NewScanner(in2)
- num := 0
- for scanner.Scan() {
- num++
- line := scanner.Text()
-
- // Skip comments, empty lines, and everything not containing
- // "Extended_Pictographic".
- if strings.HasPrefix(line, "#") || line == "" || !strings.Contains(line, "Extended_Pictographic") {
- if strings.HasPrefix(line, "#") || line == "" || !strings.Contains(line, emojiProperty) {
- continue
- }
-
Expand Down Expand Up @@ -471,7 +488,7 @@ index 6451270..0000000
-// Code generated via go generate from gen_properties.go. DO NOT EDIT.
-
-// ` + os.Args[3] + ` are taken from
-// ` + gbpURL + emojiComment + `
-// ` + propertyURL + emojiComment + `
-// on ` + time.Now().Format("January 2, 2006") + `. See https://www.unicode.org/license.html for the Unicode
-// license agreement.
-var ` + os.Args[3] + ` = [][` + strconv.Itoa(columns) + `]int{
Expand Down Expand Up @@ -520,6 +537,6 @@ index 6451270..0000000
-func translateProperty(prefix, property string) string {
- return prefix + strings.ReplaceAll(property, "_", "")
-}
--
2.37.2
--
2.38.0

14 changes: 6 additions & 8 deletions ddl/reorg.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,6 @@ func (w *worker) runReorgJob(rh *reorgHandler, reorgInfo *reorgInfo, tblInfo *mo

rc := w.getReorgCtx(job)
if rc == nil {
// Since reorg job will be interrupted for polling the cancel action outside. we don't need to wait for 2.5s
// for the later entrances.
// lease = 0 means it's in an integration test. In this case we don't delay so the test won't run too slowly.
if lease > 0 {
delayForAsyncCommit()
}
// This job is cancelling, we should return ErrCancelledDDLJob directly.
// Q: Is there any possibility that the job is cancelling and has no reorgCtx?
// A: Yes, consider the case that we cancel the job when backfilling the last batch of data, the cancel txn is commit first,
Expand Down Expand Up @@ -608,7 +602,9 @@ func getReorgInfo(ctx *JobContext, d *ddlCtx, rh *reorgHandler, job *model.Job,
})

info.first = true
// get the current version for reorganization if we don't have
if d.lease > 0 { // Only delay when it's not in test.
delayForAsyncCommit()
}
ver, err := getValidCurrentVersion(d.store)
if err != nil {
return nil, errors.Trace(err)
Expand Down Expand Up @@ -696,7 +692,9 @@ func getReorgInfoFromPartitions(ctx *JobContext, d *ddlCtx, rh *reorgHandler, jo
)
if job.SnapshotVer == 0 {
info.first = true
// get the current version for reorganization if we don't have
if d.lease > 0 { // Only delay when it's not in test.
delayForAsyncCommit()
}
ver, err := getValidCurrentVersion(d.store)
if err != nil {
return nil, errors.Trace(err)
Expand Down

0 comments on commit fc4dc4f

Please sign in to comment.