You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2019/06/15 16:22:47 UTC
[trafficserver] 17/23: Step 17: Removes versionInfo,
as well as currentVersion and highestSeen
This is an automated email from the ASF dual-hosted git repository.
zwoop pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit 36f59255e50f9348a3726e13fe1f0c8c3697dad7
Author: Leif Hedstrom <zw...@apache.org>
AuthorDate: Mon May 27 14:24:00 2019 -0600
Step 17: Removes versionInfo, as well as currentVersion and highestSeen
---
mgmt/Rollback.cc | 14 +-------------
mgmt/Rollback.h | 8 --------
2 files changed, 1 insertion(+), 21 deletions(-)
diff --git a/mgmt/Rollback.cc b/mgmt/Rollback.cc
index 5c8ec3e..c33d0d8 100644
--- a/mgmt/Rollback.cc
+++ b/mgmt/Rollback.cc
@@ -48,13 +48,8 @@ const char *RollbackStrings[] = {"Rollback Ok", "File was not found", "Version w
Rollback::Rollback(const char *fileName_, const char *configName_, bool root_access_needed_, Rollback *parentRollback_,
unsigned flags)
- : configFiles(nullptr),
- root_access_needed(root_access_needed_),
- parentRollback(parentRollback_),
- currentVersion(0),
- fileLastModified(0)
+ : configFiles(nullptr), root_access_needed(root_access_needed_), parentRollback(parentRollback_), fileLastModified(0)
{
- version_t highestSeen; // the highest backup version
ExpandingArray existVer(25, true); // Existing versions
struct stat fileInfo;
ink_assert(fileName_ != nullptr);
@@ -81,14 +76,10 @@ Rollback::Rollback(const char *fileName_, const char *configName_, bool root_acc
// ToDo: This was really broken before, it used to check if numberBackups <=0, but that could never happen.
if (flags & CONFIG_FLAG_UNVERSIONED) {
- currentVersion = 0;
setLastModifiedTime();
return;
}
- currentVersion = 0; // Prevent UMR with stat file
- highestSeen = 0;
-
// Check to make sure that our configuration file exists
//
if (statFile(&fileInfo) < 0) {
@@ -97,9 +88,6 @@ Rollback::Rollback(const char *fileName_, const char *configName_, bool root_acc
} else {
fileLastModified = TS_ARCHIVE_STAT_MTIME(fileInfo);
- currentVersion = highestSeen + 1;
-
- Debug("rollback", "[Rollback::Rollback] Current Version of %s is %d", fileName, currentVersion);
}
}
diff --git a/mgmt/Rollback.h b/mgmt/Rollback.h
index 2d4cba4..e58db4a 100644
--- a/mgmt/Rollback.h
+++ b/mgmt/Rollback.h
@@ -53,13 +53,6 @@ struct versionInfo {
//
// private functions
//
-// CURRENT_VERSION means the active version. The active version does not
-// have _version appended to its name. All prior versions are stored
-// as fileName_version. Calling file operations with CURRENT_VERSION
-// and this->currentVersion have different meanings. this->currentVersion
-// refers to a file with an _version which does not exist for the active
-// version.
-//
// statFile(struct stat*) - a wrapper for stat(), using layout engine
//
class Rollback
@@ -139,6 +132,5 @@ private:
size_t fileNameLen;
bool root_access_needed;
Rollback *parentRollback;
- version_t currentVersion;
time_t fileLastModified;
};