Skip to content
Snippets Groups Projects
Commit c5bb310a authored by Martina Ferrari's avatar Martina Ferrari
Browse files

Stop creating a tsdb lockfile by default.

Replace storage.tsdb.no-lockfile flag with storage.tsdb.use-lockfile, so the
default is not to create a lockfile, while still allowing people to request the
feature.  Closes: #890501
parent b6b86fa5
Branches
Tags
No related merge requests found
......@@ -40,8 +40,8 @@ ARGS=""
# (Defaults to 10% of the retention period)
# --storage.tsdb.retention=15d
# How long to retain samples in the storage.
# --storage.tsdb.no-lockfile
# Do not create lockfile in data directory.
# --storage.tsdb.use-lockfile
# Create a lockfile in data directory.
# --alertmanager.notification-queue-capacity=10000
# The capacity of the queue for pending alert
# manager notifications.
......
--- a/cmd/prometheus/main.go
+++ b/cmd/prometheus/main.go
@@ -164,8 +164,8 @@
a.Flag("storage.tsdb.retention", "How long to retain samples in the storage.").
Default("15d").SetValue(&cfg.tsdb.Retention)
- a.Flag("storage.tsdb.no-lockfile", "Do not create lockfile in data directory.").
- Default("false").BoolVar(&cfg.tsdb.NoLockfile)
+ a.Flag("storage.tsdb.use-lockfile", "Create a lockfile in data directory.").
+ Default("false").BoolVar(&cfg.tsdb.UseLockfile)
a.Flag("alertmanager.notification-queue-capacity", "The capacity of the queue for pending alert manager notifications.").
Default("10000").IntVar(&cfg.notifier.QueueCapacity)
--- a/storage/tsdb/tsdb.go
+++ b/storage/tsdb/tsdb.go
@@ -120,8 +120,8 @@
// Duration for how long to retain data.
Retention model.Duration
- // Disable creation and consideration of lockfile.
- NoLockfile bool
+ // Enable creation and consideration of lockfile.
+ UseLockfile bool
}
// Open returns a new storage backed by a TSDB database that is configured for Prometheus.
@@ -144,7 +144,7 @@
WALFlushInterval: 10 * time.Second,
RetentionDuration: uint64(time.Duration(opts.Retention).Seconds() * 1000),
BlockRanges: rngs,
- NoLockfile: opts.NoLockfile,
+ NoLockfile: !opts.UseLockfile,
})
if err != nil {
return nil, err
......@@ -4,3 +4,4 @@
06-Disable_kubernetes.patch
07-Fix-build-with-azure-go-autorest-8.0.0.patch
08-Fix-MainTest.patch
09-Disable_TSDB_lockfile.patch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment