Commit Graph

14860 Commits (gw_mockStartupLogger_sprintf)

Author SHA1 Message Date
Geoffrey Wossum e12e1360f7
chore: remove unnecessary fmt.Sprintf calls
Remove unnecessary fmt.Sprintf calls for static code checks in main-2.x.
2024-11-12 10:12:12 -06:00
Geoffrey Wossum 65683bf166
chore: fix logging issues in Store.loadShards (#25529)
Fix reporting shards not opening correctly when they actually did.
Fix race condition with logging in loadShards.
2024-11-12 09:34:05 -06:00
Geoffrey Wossum 0bc167bbd7
chore: loadShards changes to more cleanly support 2.x feature (#25513)
* chore: move shardID parsing and shard filtering into walkShardsAndProcess

* chore: make it impossible to miss sending shardResponse or marking shard as complete

* chore: always count number of shards (preparation for 2.x related feature)

* chore: explicitly load series files and create indices serially

Explicitly load series files and create indices serially. Also
avoid passing them to work functions that don't need them.

* chore: rework loadShards for changes necessary to cancel loading process

* chore: comment improvements

* fix: fix race conditions in TestStore_StartupShardProgress and TestStore_BadShardLoading

* chore: avoid logging nil error

* chore: refactor shard loading and shard walking

Refactor loadShards and CreateShard to use a common shardLoader class that
makes thread-safety easier. Refactor walkShardsAndProcess into findShards.

* chore: improve comment

* chore: rename OpenShard to ReopenShard and implement with shardLoader

Rename Store.OpenShard to Store.ReopenShard and implement using a
shardLoader object. Changes to tests as necessary.

* chore: avoid resetting shard options and locking on Reopen

Avoid resetting shard options when reopening a shard.
Proper mutex locker in Shard.ReopenShard.

* chore: fix formatting issue

* chore: warn on mixed index types in Store.CreateShard

* chore: change from info to warn when invalid shard IDs found in path

* chore: use coarser locking in Store.ReopenShard

* chore: fix typo in comment

* chore: code simplification
2024-11-08 15:49:48 -06:00
WeblWabl 2cab9a2a1f
feat: Adds functionality to clear out bad shard list (#25398)
* feat(tsdb): Adds functionality to clear bad shards list

This PR adds test and new method to clear out the bad shards list
the method will return the values of the shards that it cleared out
along with the errors. This is the first part in the feature
for adding a load-shards command to influxd-ctl.

Closes influxdata/feature-requests#591
2024-10-18 13:22:32 -05:00
Geoffrey Wossum 86e81167b8
feat: allow `influx -import` to import from stdin (#25472)
Allow `influx -import` to import from stdin by specifying `-` as the path.
Example: `influx -import -path -`
2024-10-17 14:33:56 -05:00
WeblWabl 3c87f524ed
feat(logging): Add startup logging for shard counts (#25378)
* feat(tsdb): Adds shard opening progress checks to startup
This PR adds a check to see how many shards are remaining
vs how many shards are opened. This change displays the percent
completed too.

closes influxdata/feature-requests#476
2024-10-16 10:09:15 -05:00
Shiwen Cheng 860a74f8a5
fix(backup): fix DBRetentionAndShardFromPath parsing error between-different-os (#25362)
Split paths by both forward and back slashes.

Closes https://github.com/influxdata/influxdb/issues/25361
2024-09-27 16:47:33 -07:00
Shiwen Cheng 1bc0eb4795
fix(tsm1): Fix data race of seriesKeys in deleteSeriesRange (#25268)
Add an RWMutex to allow safe concurrent 
access in deleteSeriesRange
2024-09-27 16:36:27 -07:00
Shiwen Cheng 8419439e89
test: fix MeasurementNamesFn missing retentionPolicy parameter (#25275)
Add retention policy to the test function for measurement names,
instead of ignoring the argument passed in.
2024-09-27 15:58:47 -07:00
davidby-influx e3e9232de5
fix: strip double quotes from measurement names in v2/delete (#25407)
When searching for a measurement in the v2/delete API,
remove any quotes put on the measurement name (e.g. to
alllow special characters) before string comparisons.

closes https://github.com/influxdata/influxdb/issues/25406
2024-09-27 09:35:26 -07:00
WeblWabl 599e4f7be3
feat(ci): Update master-1.x to go1.22.7 (#25365) 2024-09-18 14:20:15 -05:00
WeblWabl 8eaa24d813
feat(tsm): Allow for deletion of series outside default rp (#25312)
* feat(tsm): Allow for deletion of series outside default RP
9d116f6
This PR adds the ability for deletion of series that are outside
of the default retention policy. This updates InfluxQL to include changes
from: influxdata/influxql#71

closes: influxdata/feature-requests#175

* feat(tsm): Allow for deletion of series outside default RP
9d116f6
This PR adds the ability for deletion of series that are outside
of the default retention policy. This updates InfluxQL to include changes
from: influxdata/influxql#71

closes: influxdata/feature-requests#175
2024-09-17 16:34:14 -05:00
WeblWabl fdf0df7455
fix(ci): Update test_pkgs_64bit image to non-eol ubuntu image (#25354)
* fix(ci): Update test_pkgs_64bit image to non-eol ubuntu image

* fix: trying edge img

* fix(ci): update ubuntu image in ci
Update test_pkgs_64bit image to non-eol ubuntu image

Please see: discuss.circleci.com/t/linux-image-deprecations-and-eol-for-2024/50177

closes https://github.com/influxdata/influxdb/issues/25355
2024-09-17 15:34:04 -05:00
WeblWabl 5c9e45f033
fix(tsi1/partition/test): fix data races in test code (#57) (#25338)
* fix(tsi1/partition/test): fix data races in test code (#57)

* fix(tsi1/partition/test): fix data races in test code

This PR is like influxdata/influxdb#24613 but solves it with a setter
method for MaxLogFileSize which allows unexporting that value and
MaxLogFileAge. There are actually two places locks were needed in test
code. The behavior of production code is unchanged.

(cherry picked from commit f0235c4daf4b97769db932f7346c1d3aecf57f8f)

* feat: modify error handling to be more idiomatic

closes https://github.com/influxdata/influxdb/issues/24042

* fix: errors.Join() filters nil errors

---------

Co-authored-by: Phil Bracikowski <13472206+philjb@users.noreply.github.com>
2024-09-16 20:26:14 -05:00
Geoffrey Wossum 23008e5286
chore: improve error messages and logging during shard opening (#25314)
* chore: improve error messages and logging during shard opening
2024-09-12 15:11:56 -05:00
WeblWabl a6a3bdd0f0
feat(edge): Add 'flux enabled' to 'show diagnostics' (#25308)
* feat(edge): Add 'flux enabled' to 'show diagnostics'

* fix(ci): empty for ci re-run
2024-09-12 11:43:02 -05:00
davidby-influx 5d8d1120e1
fix: add additional logging on loading fields.idxl files (#25309)
Log the path of the file being loaded, and when level=debug
log progress fpr each set of field changes

closes https://github.com/influxdata/influxdb/issues/25289
2024-09-12 08:25:02 -07:00
WeblWabl 7dc8b1d648
fix(tsi1/partition/test): fix data race in test code (#25288) 2024-09-11 19:48:41 -05:00
Shiwen Cheng b233f51045
fix(coordinator): fix closing channel created twice in points writer (#25291) 2024-09-09 15:26:36 -07:00
Shiwen Cheng f01181a7a1
fix: fix typo 'exceeed' with 'exceeded' (#25292) 2024-09-09 15:15:25 -07:00
Shiwen Cheng 4d34a21854
fix(config): fix max-concurrent-deletes typo in config.sample.toml (#25293) 2024-09-09 15:13:51 -07:00
Jamie Strandboge 0582cf4148
chore: upgrade to Go 1.21.12 (#25199) 2024-09-05 11:01:35 -05:00
Geoffrey Wossum 2cf2103cc4
feat: add hook for optimizing series reads based on authorizer (#25207) 2024-08-02 15:03:44 -05:00
Shiwen Cheng 7333da9592
fix(tsi1): fix data race between appendEntry and FlushAndSync tsi1.(*LogFile) (#25182)
Extend lock lifespan to encompass the 
flushAndSync() call to avoid a race

closes https://github.com/influxdata/influxdb/issues/25181
2024-07-23 14:40:10 -07:00
davidby-influx c4bfaa8954
fix: Store.validateArgs wrongfully overwriting start, end unix time (#25146) (#25165)
When querying data before 1970-01-01 (UNIX time 0)
validateArgs would set start to -in64 max and end to int64 max.

closes https://github.com/influxdata/influxdb/issues/24669

Co-authored-by: Paul Hegenberg <paul.hegenberg@gmail.com>

closes https://github.com/influxdata/influxdb/issues/25149
2024-07-16 08:35:17 -07:00
davidby-influx 176fca2138
fix: prevent an infinite loop in measurementFieldSetChangeMgr (#25155)
The measurementFieldSetChangeMgr has a possibly infinite loop
if the writeRequests channel is closed while in the inner
loop to consolidate write requests. We need to check for ok
on channel receive and exit the loop when ok is false.

closes https://github.com/influxdata/influxdb/issues/25151
2024-07-12 16:52:28 -07:00
peterbarnett03 6f46706b52
chore: Updating 1.x README for clarity and direction (#25107)
Co-authored-by: Peter Barnett <peterbarnett@Peters-MBP.hsd1.sc.comcast.net>
2024-06-27 12:49:12 -04:00
davidby-influx d60741b506
fix: GROUP BY queries with offset that crosses a DST boundary fail. (#25082)
This is actually the second fix for
https://github.com/influxdata/influxdb/issues/20238
for when the time zone falls back in autumn.

closes https://github.com/influxdata/influxdb/issues/25078
2024-06-24 10:24:34 -07:00
Geoffrey Wossum b4bd607eef
fix: prevent retention service from hanging (#25055)
* fix: prevent retention service from hanging

Fix issue that can cause the retention service to hang waiting on a
`Shard.Close` call. When this occurs, no other shards will be deleted
by the retention service. This is usually noticed as an increase in
disk usage because old shards are not cleaned up.

The fix adds to new methods to `Store`, `SetShardNewReadersBlocked`
and `InUse`. `InUse` can be used to poll if a shard has active readers,
which the retention service uses to skip over in-use shards to prevent
the service from hanging. `SetShardNewReadersBlocked` determines if
new read access may be granted to a shard. This is required to prevent
race conditions around the use of `InUse` and the deletion of shards.

If the retention service skips over a shard because it is in-use, the
shard will be checked again the next time the retention service is run.
It can be deleted on subsequent checks if it is no longer in-use. If
the shards is stuck in-use, the retention service will not be able to
delete the shards, which can be observed in the logs for manual
intervention. Other shards can still be deleted by the retention service
even if a shard is stuck with readers.

closes: #25054
2024-06-13 11:07:17 -05:00
davidby-influx b09e4b751f
fix: ignore empty index error deleting last measurement (#25037)
An empty index is appropriate when deleting the last
measurement.  Also clean up error handling, avoid
duplicate calls to Close.

closes https://github.com/influxdata/influxdb/issues/9929
2024-06-04 12:29:39 -07:00
davidby-influx 5fda409f39
fix: return MergeIterator.Close errors (#24975)
Ensure that errors from closing the
iterators underneath a MergeIterator
are returned up the stack.
2024-05-13 15:10:56 -07:00
Jakub Bednář d1da48634a
chore: upgrade go 1.21.9 -> 1.21.10 (master-1.x) (#24985) 2024-05-10 08:38:58 -05:00
davidby-influx 82cbdb5478
fix: ensure TSMBatchKeyIterator and FileStore close all TSMReaders (#24957)
Do not let errors on closing 
a TSMReader prevent other 
closes.
2024-05-06 09:59:30 -07:00
Brandon Pfeifer d4b16dcd98
chore: upgrade protocol buffers to v5.26.1 (#24949) 2024-05-01 11:00:26 -07:00
Jamie Strandboge f231da818f
chore: update golang.org/x/net to v0.23.0 (master-1.x) (#24930) 2024-04-19 12:13:08 -05:00
Brandon Pfeifer 44084c0f05
chore: upgrade go toolchain to 1.21.9 (#24912) 2024-04-12 14:48:57 -04:00
Jakub Bednář dbbe4611c0
build(deps): upgrade google.golang.org/protobuf to v1.33.0 (master-1.x) (#24818) 2024-03-26 14:07:28 +01:00
davidby-influx fe6c64b21e
fix: return and respect cursor errors (#24791)
ArrayCursors were ignoring errors, which led to panics when nil
cursors were operated on. This fix passes errors back up the stack
and uses them to enforce healthy cursor creation.

Closes https://github.com/influxdata/influxdb/issues/24789
---------
Co-authored-by: Stuart Carnie <stuart.carnie@gmail.com>
2024-03-25 17:22:33 -07:00
davidby-influx 8ff06d5a92
fix: improved shard deletion (#24602)
Avoid unnecessarily deleting series from the series file
Try harder to delete series from InMem indices
Log all errors on shard deletion

Closes https://github.com/influxdata/influxdb/issues/24834
2024-03-25 17:15:31 -07:00
davidby-influx bc80e881fa
fix: do not panic when empty tags are queried (#24784)
Do not panic if a cursor array is nil and the number
of timestamps is retrieved.

closes https://github.com/influxdata/influxdb/issues/24536
2024-03-18 15:28:29 -07:00
Brandon Pfeifer 393178892e
fix: update "equals" to "equal" (#24777) 2024-03-15 16:55:41 -04:00
Brandon Pfeifer 59e84cc48b
chore: refactor unit tests (#24774) 2024-03-15 14:21:27 -04:00
Geoffrey Wossum 8648298012
chore: upgrade to influxdata/influxql v1.2.0 (#24764)
Upgrade to influxdata/influxql v1.2.0. While it does not fix any
known issues in InfluxDB OSS 1.x, it is necessary for upstream
projects impacted by https://github.com/influxdata/influxql/issues/65.

In addition to upgrading influxdata/influxql, this also updates test
cases that relied on the erroneous precision handling when stringifying
InfluxQL ASTs.

Visible impacts to InfluxDB OSS 1.x:
- Changes precision of floating point numbers in error messages
  related to InfluxQL
- Changes precision of floating point numbers in "EXPLAIN" and
  "EXPLAIN ANALYZE" output
- Changes precision of floating point numbers from InfluxQL
  expressions included in tracing spans

closes: #24763
2024-03-14 12:42:03 -05:00
Brandon Pfeifer 5ade548ea5
chore: upgrade go toolchain to 1.21.8 (master-1.x) (#24762) 2024-03-13 16:49:52 -04:00
Brandon Pfeifer 61f965a4b6
chore: use 'packager' and 'slack' images (#24742) 2024-03-12 15:26:11 -04:00
Brandon Pfeifer a688bdcf02
chore: upgrade to go1.21.6 (#24711) 2024-03-05 12:07:40 -05:00
Geoffrey Wossum ad7774df3e
fix: correct dependencies in package builds (1.11) (#24670) (#24675)
* chore: update ubuntu to 2204:current

* fix: install asciidoc with pip

(cherry picked from commit 70acbd58a8)
2024-02-16 17:09:24 -06:00
alespour 99a2261b9f
chore: upgrade golang 1.20.10 -> 1.20.13 (#24590) 2024-01-23 10:26:22 -06:00
Jack 6af0be9234
fix: panic index out of range for invalid series keys (#24565)
* chore: add scaffolding for naive solution

* feat: test case scaffolding

* fix: implement check for series key before proceeding

* fix: add validation for ReadSeriesKeyMeasurement usage

* refactor: explicit use of series key len

* feat: add remaining check to index

* feat: add check to remaining files

As the Len function is used as part of the parseSeriesKey, this also needs to be accounted for on the nil return from this function as it is used in different contexts

* feat: expand test cases

* chore: go fmt

* chore: update test failure message

* chore: impl feedback on unnecessary sz checks

* feat: expand test cases

* fix: nil series key check

In both sections for index.go there is a pre-existing length check against the series key which should catch invalid values, perhaps this explains why it hasn't cropped up in the reported panics. For even more safety, we can also skip a nil key because we know that subsequent calls will cause a panic where this key is attempted to be used

* fix: remove nil tags check

A key with no tags is valid, so we should not check for BOTH nil key and tags as a key could be nil, which is invalid, yet still have tags and therefore cause the check to pass which we do not want

* feat: extend test cases from feedback

* fix: extend checks for CompareSeriesKeys

* feat: add nilKeyHandler for shared key checking logic

* fix: logical error in nilKeyHandler

Prior to this, the else was always defaulted to at the end of the conditional branch, which causes unexpected behaviour and a failure of a bunch of tests.

* fix: return tags keep nil data

In a recent change to this, we agreed on a simple name == nil check for the actual data. As a follow on to this, I just realised that we don't actually want to nil back the tags, even if they're not checked, because having no tags is a valid input so we can simply return whatever we were passed unchanged.

* fix: use len == 0 for extra safety

* feat: extra test for blank series key
2024-01-23 09:44:29 +00:00
davidby-influx c05b340b72
chore: upgrade flux (#24504)
* chore: upgrade flux

* chore: execute "go generate" inside cross-builder (#24582)

---------

Co-authored-by: Brandon Pfeifer <bpfeifer@influxdata.com>
2024-01-19 17:40:48 -05:00