diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-11-25 17:33:56 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-11-25 17:34:10 +0000 |
commit | 83ba6762cc43d9db581b979bb5e3445669e46cc2 (patch) | |
tree | 2e69833b43f791ed253a7a20318b767ebe56cdb8 /src/database/engine/datafile.c | |
parent | Releasing debian version 1.47.5-1. (diff) | |
download | netdata-83ba6762cc43d9db581b979bb5e3445669e46cc2.tar.xz netdata-83ba6762cc43d9db581b979bb5e3445669e46cc2.zip |
Merging upstream version 2.0.3+dfsg (Closes: #923993, #1042533, #1045145).
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/database/engine/datafile.c')
-rw-r--r-- | src/database/engine/datafile.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/database/engine/datafile.c b/src/database/engine/datafile.c index 35c047722..7bf9487f2 100644 --- a/src/database/engine/datafile.c +++ b/src/database/engine/datafile.c @@ -66,7 +66,8 @@ void datafile_release(struct rrdengine_datafile *df, DATAFILE_ACQUIRE_REASONS re spinlock_unlock(&df->users.spinlock); } -bool datafile_acquire_for_deletion(struct rrdengine_datafile *df) { +bool datafile_acquire_for_deletion(struct rrdengine_datafile *df, bool is_shutdown) +{ bool can_be_deleted = false; spinlock_lock(&df->users.spinlock); @@ -107,7 +108,7 @@ bool datafile_acquire_for_deletion(struct rrdengine_datafile *df) { if(!df->users.time_to_evict) { // first time we did the above - df->users.time_to_evict = now_s + 120; + df->users.time_to_evict = now_s + (is_shutdown ? DATAFILE_DELETE_TIMEOUT_SHORT : DATAFILE_DELETE_TIMEOUT_LONG); internal_error(true, "DBENGINE: datafile %u of tier %d is not used by any open cache pages, " "but it has %u lockers (oc:%u, pd:%u), " "%zu clean and %zu hot open cache pages " @@ -572,8 +573,8 @@ void finalize_data_files(struct rrdengine_instance *ctx) struct rrdengine_journalfile *journalfile = datafile->journalfile; logged = false; - size_t iterations = 100; - while(!datafile_acquire_for_deletion(datafile) && datafile != ctx->datafiles.first->prev && --iterations > 0) { + size_t iterations = 10; + while(!datafile_acquire_for_deletion(datafile, true) && datafile != ctx->datafiles.first->prev && --iterations > 0) { if(!logged) { netdata_log_info("Waiting to acquire data file %u of tier %d to close it...", datafile->fileno, ctx->config.tier); logged = true; |