Commit Graph

35252 Commits (903d30d65894cd282eae91c4026e39fe57a7b538)

Author SHA1 Message Date
Eng Zer Jun 903d30d658
test: use `T.TempDir` to create temporary test directory (#23258)
* test: use `T.TempDir` to create temporary test directory

This commit replaces `os.MkdirTemp` with `t.TempDir` in tests. The
directory created by `t.TempDir` is automatically removed when the test
and all its subtests complete.

Prior to this commit, temporary directory created using `os.MkdirTemp`
needs to be removed manually by calling `os.RemoveAll`, which is omitted
in some tests. The error handling boilerplate e.g.
	defer func() {
		if err := os.RemoveAll(dir); err != nil {
			t.Fatal(err)
		}
	}
is also tedious, but `t.TempDir` handles this for us nicely.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

* test: fix failing TestSendWrite on Windows

=== FAIL: replications/internal TestSendWrite (0.29s)
    logger.go:130: 2022-06-23T13:00:54.290Z	DEBUG	Created new durable queue for replication stream	{"id": "0000000000000001", "path": "C:\\Users\\circleci\\AppData\\Local\\Temp\\TestSendWrite1627281409\\001\\replicationq\\0000000000000001"}
    logger.go:130: 2022-06-23T13:00:54.457Z	ERROR	Error in replication stream	{"replication_id": "0000000000000001", "error": "remote timeout", "retries": 1}
    testing.go:1090: TempDir RemoveAll cleanup: remove C:\Users\circleci\AppData\Local\Temp\TestSendWrite1627281409\001\replicationq\0000000000000001\1: The process cannot access the file because it is being used by another process.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

* test: fix failing TestStore_BadShard on Windows

=== FAIL: tsdb TestStore_BadShard (0.09s)
    logger.go:130: 2022-06-23T12:18:21.827Z	INFO	Using data dir	{"service": "store", "path": "C:\\Users\\circleci\\AppData\\Local\\Temp\\TestStore_BadShard1363295568\\001"}
    logger.go:130: 2022-06-23T12:18:21.827Z	INFO	Compaction settings	{"service": "store", "max_concurrent_compactions": 2, "throughput_bytes_per_second": 50331648, "throughput_bytes_per_second_burst": 50331648}
    logger.go:130: 2022-06-23T12:18:21.828Z	INFO	Open store (start)	{"service": "store", "op_name": "tsdb_open", "op_event": "start"}
    logger.go:130: 2022-06-23T12:18:21.828Z	INFO	Open store (end)	{"service": "store", "op_name": "tsdb_open", "op_event": "end", "op_elapsed": "77.3µs"}
    testing.go:1090: TempDir RemoveAll cleanup: remove C:\Users\circleci\AppData\Local\Temp\TestStore_BadShard1363295568\002\data\db0\rp0\1\index\0\L0-00000001.tsl: The process cannot access the file because it is being used by another process.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

* test: fix failing TestPartition_PrependLogFile_Write_Fail and TestPartition_Compact_Write_Fail on Windows

=== FAIL: tsdb/index/tsi1 TestPartition_PrependLogFile_Write_Fail/write_MANIFEST (0.06s)
    testing.go:1090: TempDir RemoveAll cleanup: remove C:\Users\circleci\AppData\Local\Temp\TestPartition_PrependLogFile_Write_Failwrite_MANIFEST656030081\002\0\L0-00000003.tsl: The process cannot access the file because it is being used by another process.
    --- FAIL: TestPartition_PrependLogFile_Write_Fail/write_MANIFEST (0.06s)

=== FAIL: tsdb/index/tsi1 TestPartition_Compact_Write_Fail/write_MANIFEST (0.08s)
    testing.go:1090: TempDir RemoveAll cleanup: remove C:\Users\circleci\AppData\Local\Temp\TestPartition_Compact_Write_Failwrite_MANIFEST3398667527\002\0\L0-00000003.tsl: The process cannot access the file because it is being used by another process.
    --- FAIL: TestPartition_Compact_Write_Fail/write_MANIFEST (0.08s)

We must close the open file descriptor otherwise the temporary file
cannot be cleaned up on Windows.

Fixes: 619eb1cae6 ("fix: restore in-memory Manifest on write error")
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

* test: fix failing TestReplicationStartMissingQueue on Windows

=== FAIL: TestReplicationStartMissingQueue (1.60s)
    logger.go:130: 2023-03-17T10:42:07.269Z	DEBUG	Created new durable queue for replication stream	{"id": "0000000000000001", "path": "C:\\Users\\circleci\\AppData\\Local\\Temp\\TestReplicationStartMissingQueue76668607\\001\\replicationq\\0000000000000001"}
    logger.go:130: 2023-03-17T10:42:07.305Z	INFO	Opened replication stream	{"id": "0000000000000001", "path": "C:\\Users\\circleci\\AppData\\Local\\Temp\\TestReplicationStartMissingQueue76668607\\001\\replicationq\\0000000000000001"}
    testing.go:1206: TempDir RemoveAll cleanup: remove C:\Users\circleci\AppData\Local\Temp\TestReplicationStartMissingQueue76668607\001\replicationq\0000000000000001\1: The process cannot access the file because it is being used by another process.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

* test: update TestWAL_DiskSize

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

* test: fix failing TestWAL_DiskSize on Windows

=== FAIL: tsdb/engine/tsm1 TestWAL_DiskSize (2.65s)
    testing.go:1206: TempDir RemoveAll cleanup: remove C:\Users\circleci\AppData\Local\Temp\TestWAL_DiskSize2736073801\001\_00006.wal: The process cannot access the file because it is being used by another process.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

---------

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2023-03-21 16:22:11 -04:00
anon8675309 96d6dc3d82
fix: Removed timeout which is hit with large databases or slow servers #22803 (#23400)
Co-authored-by: anon8675309 <m7gy7uav@duck.com>
2023-03-21 10:47:55 -04:00
L1Cafe 5a7ce078f5
fix: scraping failed when Content-Type header is not set (#24135)
Co-authored-by: L1Cafe <L1Cafe@donotemail.me>
2023-03-14 10:13:28 -04:00
Jeffrey Smith II e1d0102a6f
fix: add error message when attempting to delete by field (#24131)
* fix: add error message when attempting to delete by field

* test: add test for delete by field
2023-03-10 09:13:24 -05:00
Jeffrey Smith II b819edf095
fix: rename replication fields for better clarity (#24126)
* fix: rename replication fields for better clarity

* fix: dont rename, only add new field
2023-03-09 13:11:43 -05:00
Jeffrey Smith II 77fd64a975
fix: handle replication missing queue (#24123)
* fix: replications should startup after backup/restore

* chore: refactor

* test: improve logging and handle test better
2023-03-09 13:10:53 -05:00
Ikko Eltociear Ashimine 387d9007a7
chore: fix typo in functions.go (#24133)
intial -> initial
2023-03-09 12:40:17 -05:00
fuyou 22d698bd7e
fix(sec): upgrade containerd to 1.6.18 (#24129) 2023-03-09 12:39:30 -05:00
Jamie Strandboge 569e84d4a7
chore: use go 1.20.1 (#24114) 2023-03-01 15:49:27 -06:00
dependabot[bot] 23446cc371
build(deps): bump golang.org/x/net from 0.5.0 to 0.7.0 (#24112)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.5.0 to 0.7.0.
- [Release notes](https://github.com/golang/net/releases)
- [Commits](https://github.com/golang/net/compare/v0.5.0...v0.7.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-28 12:30:15 -05:00
Christopher M. Wolff a035bcfb6e
build(flux): update flux to v0.193.0 (#24103) 2023-02-23 10:18:46 -08:00
wiedld 4fc73ea221
feat(monitor-ci/415): get oss-e2es working locally in UI repo (#24098)
* feat(monitor-ci/415): get oss-e2es working locally in UI repo

* chore: remove old, unused artifact directories

* fix: handle import cycle caused by trying to use the onboarding client

---------

Co-authored-by: Jeffrey Smith II <jsmith@influxdata.com>
2023-02-22 09:28:46 -05:00
Manuel de la Peña 260d88b45d
chore: bump testcontainers-go to 0.18.0 (#24097) 2023-02-21 10:07:17 -05:00
Jeffrey Smith II f74c69c5e4
chore: update to go 1.20 (#24088)
* build: upgrade to go 1.19

* chore: bump go.mod

* chore: `gofmt` changes for doc comments

https://tip.golang.org/doc/comment

* test: update tests for new sort order

* chore: make generate-sources

* chore: make generate-sources

* chore: go 1.20

* chore: handle rand.Seed deprecation

* chore: handle rand.Seed deprecation in tests

---------

Co-authored-by: DStrand1 <dstrandboge@influxdata.com>
2023-02-09 14:14:35 -05:00
Jeffrey Smith II 8ad6e17265
chore: add additional error logging when deleting shard (#24038)
* chore: add additional error logging when deleting shard

* chore: better logging message
2023-02-09 09:10:25 -05:00
Jeffrey Smith II 06a59020d0
fix: prevent unauthorized writes in flux "to" function (#24077)
* fix: prevent unauthorized writes in flux "to" function

* test: add test for "to" permissions fix
2023-02-06 10:07:18 -05:00
suitableZebraCaller ec7fdd3a58
fix: Show Replication Queue size and Replication TCP Errors (#23960)
* feat: Show remaining replication queue size

* fix: Show non-http related error messages

* fix: Show non-http related error messages with backoff

* fix: Updates for replication tests

* chore: formatting

* chore: formatting

* chore: formatting

* chore: formatting

* chore: lowercase json field

---------

Co-authored-by: Geoffrey <suitableZebraCaller@users.noreply.github.com>
Co-authored-by: Jeffrey Smith II <jeffreyssmith2nd@gmail.com>
2023-02-02 09:47:45 -05:00
dependabot[bot] e2f835bb0f
build(deps): bump github.com/aws/aws-sdk-go from 1.30.12 to 1.33.0 (#24070)
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.30.12 to 1.33.0.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/v1.33.0/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.30.12...v1.33.0)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: indirect
...

closes https://github.com/influxdata/edge/issues/371

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-30 15:08:33 -08:00
Joshua Powers 109bc88512
chore: update package repo GPG key (#24061) 2023-01-26 16:10:09 -07:00
Chunchun Ye 8ed55e72b8
build(flux): update flux to v0.192.0 (#24028) 2023-01-13 10:22:57 -06:00
Jeffrey Smith II 6b60728843
fix: Update UI to resolve Dashboard crash and All Access Token creati… (#24017)
* fix: Update UI to resolve Dashboard crash and All Access Token creation (#24014)

* chore: update docs around ui releases
2023-01-04 09:49:21 -05:00
Jeffrey Smith II 24a2b621ea
fix: Pin UI to older version to address Dashboard issues (#23980) 2022-12-15 11:49:43 -05:00
Jeffrey Smith II ffd069a8a5
fix: handle NaN in scraper (#23944)
* fix: handle NaN values in scraper

* chore: a converted int will never be NaN
2022-12-13 15:58:50 -05:00
Brandon Pfeifer ade21ad9a1
fix: restrict file permissions by default (#23959)
Most of these changes can be overridden by the system
maintainer with environment variables or systemd
override snippets.
2022-12-13 11:00:50 -05:00
Jamie Strandboge cee487fe21
chore: update Go to 1.18.9 (#23973) 2022-12-07 15:25:06 -06:00
Brandon Pfeifer 853d6157e3
feat: perform basic package validation (#23863)
* chore: remove unused build/ci scripts

* feat: validate packages during build

* chore: test CentOS aarch64 package

* fix: remove x86_64 from parameterized workflow

* fix: don't upgrade packages

Since some unrelated packages break during upgrade, this
no longer upgrades the system before installing
influxdb.
2022-12-01 10:58:33 -05:00
Manuel de la Peña 26daa86648
chore: bump testcontainers to latest released version (#23858)
* chore: bump testcontainers to v0.15.0

* chore: run go mod tidy

* chore: update test to latest version of testcontainers

* chore: update package

* fix: use collectors.NewGoCollector instead

SA1019 detected by staticcheck
2022-11-23 13:18:10 -05:00
Jeffrey Smith II ef098ac65f
chore: cleanup codeowners file (#23940) 2022-11-22 10:28:40 -05:00
Jeffrey Smith II c2eac86131
feat: port report-db command from 1.x (#23922)
* feat: port report-db command from 1.x

* chore: fix linting

* chore: rename db to bucket

* chore: fix linting
2022-11-21 11:23:13 -05:00
Jeffrey Smith II 77081081b5
feat: port check-schema and merge-schema from 1.x (#23921)
* feat: add check-schema and merge-schema commands to influx inspect

* chore: fix linting

* fix: add warning if fields.idxl is encountered
2022-11-21 10:39:50 -05:00
Jeffrey Smith II 9bf8840a63
fix: update me and users routes to match cloud/documentation (#23837)
* fix: update me and users routes to match cloud/documentation

* fix: handle errors in user routes properly
2022-11-21 10:39:30 -05:00
Jeffrey Smith II f026d7bdaf
fix: Fixes migrating when a remote already exists (#23912)
* fix: handle migrating with already defined remotes

* test: add test to verify migrating already defined remotes

* fix: properly handle Up
2022-11-17 14:23:10 -05:00
Ole Kristian (Zee) 666cabb1f4
fix: fix wrong max age transformation from seconds (#23684)
* fix: fix wrong max age transformation from seconds

* refactor: clarify max age intent

* refactor: remove unnecessary duration
2022-11-16 16:18:43 -05:00
davidby-influx 7ad8fbad22
chore: fix trace message text (#23918) 2022-11-16 08:40:26 -05:00
Nathaniel Cook 07e6ef2839
build(flux): update flux to v0.191.0 (#23913) 2022-11-15 12:57:16 -07:00
Sam Arnold 4de89afd37
refactor: remove dead iterator code (#23887)
* fix: codegen without needing goimports

* refactor: remove dead code
2022-11-09 19:26:12 -05:00
Jeffrey Smith II 46464f409c
fix: Optimize SHOW FIELD KEY CARDINALITY (#23886)
Use the _fieldKeys system iterator
2022-11-09 14:51:41 -05:00
Jeffrey Smith II 8f936e9e6a
Revert "fix: set limited permissions on package installs (#23683)" (#23855)
This reverts commit 8d5f0b52f3.
2022-11-04 15:56:56 -04:00
Jeffrey Smith II 61870e5202
chore: update 2.5 changelog (#23848)
* chore: update 2.5 changelog

* chore: release 2.5.1 influxdb
2022-11-04 15:56:07 -04:00
Christopher M. Wolff 86207fe46a
build(flux): update flux to v0.189.0 (#23853) 2022-11-03 11:03:33 -07:00
Jamie Strandboge e62c8abaa9
chore: upgrade to Go 1.18.8 (#23852) 2022-11-02 17:18:42 -05:00
Dane Strandboge 6fc66acb0a
fix: do not require remoteOrgID in remote config/creation request (#23838) 2022-11-01 09:47:45 -05:00
Christopher M. Wolff 8c23f927b5
build(flux): update flux to v0.188.1 (#23844) 2022-10-31 10:37:46 -07:00
Jeffrey Smith II 9582826b3f
fix: handle a potential nil iterator leading to a panic (#23520)
* fix: handle a potential nil iterator leading to a panic

* chore: cleanup
2022-10-31 08:54:57 -04:00
Sunil Kartikey 1033334482
build(flux): update flux to v0.188.0 (#23836) 2022-10-25 17:56:52 +01:00
Jeffrey Smith II e61485a847
fix: only the latest scraper being run (#23813)
* fix: only the latest scraper being run

This is due to the Golang for-loop variable problem.

* chore: improve code readability
2022-10-20 13:33:41 -04:00
Cyril Bonté 81e2ec617d
fix: enable gzipped responses with the legacy handler (#23805) (#23806)
re-enable gzip compression on the legacy handler, as it was supported in
influxdb 1.x.

Co-authored-by: Cyril Bonté <cyril.bonte@fr.clara.net>
2022-10-20 09:24:05 -04:00
charlesmahler fa393ccb59
chore(readme): add resource links and logo (#23735) 2022-10-20 09:04:22 -04:00
Dane Strandboge 55b7d29e4f
fix: sql scan error on remote bucket id when replication to 1.x (#23826) 2022-10-19 14:51:48 -05:00
Jeffrey Smith II 3ac7a10aa9
fix: downgrading to 2.3 was broken (#23814) 2022-10-19 15:13:39 -04:00