trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zw...@apache.org
Subject [trafficserver] branch master updated: Removes the snapshot API and features
Date Mon, 09 Oct 2017 19:08:11 GMT
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


The following commit(s) were added to refs/heads/master by this push:
     new ca11933  Removes the snapshot API and features
ca11933 is described below

commit ca119339a8425c0b8c409d33d92cf056b6dfe4aa
Author: Leif Hedstrom <zwoop@apache.org>
AuthorDate: Thu Sep 14 17:38:38 2017 -0600

    Removes the snapshot API and features
    
    This is step one towards cleaning up how we manage configuration
    files. This is an incompatible change, but I think it should work
    fine for most.
---
 cmd/traffic_layout/traffic_layout.cc        |   1 -
 doc/admin-guide/files/records.config.en.rst |   6 -
 lib/perl/lib/Apache/TS/AdminClient.pm       |  45 +--
 lib/records/I_RecCore.h                     |   3 -
 lib/records/RecCore.cc                      |   9 -
 mgmt/FileManager.cc                         | 529 ----------------------------
 mgmt/FileManager.h                          |  51 +--
 mgmt/Makefile.am                            |   2 -
 mgmt/MultiFile.cc                           | 241 -------------
 mgmt/MultiFile.h                            |  82 -----
 mgmt/RecordsConfig.cc                       |   2 -
 mgmt/WebMgmtUtils.cc                        |  92 -----
 mgmt/WebMgmtUtils.h                         |   4 -
 mgmt/api/APITestCliRemote.cc                |  94 -----
 mgmt/api/CoreAPI.cc                         |  85 -----
 mgmt/api/CoreAPI.h                          |   8 -
 mgmt/api/CoreAPIRemote.cc                   |  46 ---
 mgmt/api/EventControlMain.cc                |   4 -
 mgmt/api/INKMgmtAPI.cc                      |  25 --
 mgmt/api/NetworkMessage.cc                  |  12 -
 mgmt/api/NetworkMessage.h                   |   4 -
 mgmt/api/TSControlMain.cc                   |  99 ------
 mgmt/api/include/mgmtapi.h                  |  25 --
 23 files changed, 24 insertions(+), 1445 deletions(-)

diff --git a/cmd/traffic_layout/traffic_layout.cc b/cmd/traffic_layout/traffic_layout.cc
index 0fb11d6..0b08fe0 100644
--- a/cmd/traffic_layout/traffic_layout.cc
+++ b/cmd/traffic_layout/traffic_layout.cc
@@ -167,7 +167,6 @@ produce_layout(bool json)
   print_var("RUNTIMEDIR", RecConfigReadRuntimeDir(), json);
   print_var("PLUGINDIR", RecConfigReadPluginDir(), json);
   print_var("INCLUDEDIR", Layout::get()->includedir, json);
-  print_var("SNAPSHOTDIR", RecConfigReadSnapshotDir(), json);
 
   print_var("records.config", RecConfigReadConfigPath(nullptr, REC_CONFIG_FILE), json);
   print_var("remap.config", RecConfigReadConfigPath("proxy.config.url_remap.filename"), json);
diff --git a/doc/admin-guide/files/records.config.en.rst b/doc/admin-guide/files/records.config.en.rst
index cf1b921..21359d2 100644
--- a/doc/admin-guide/files/records.config.en.rst
+++ b/doc/admin-guide/files/records.config.en.rst
@@ -334,12 +334,6 @@ System Variables
 
    Specifies at what size to roll the output log at.
 
-.. ts:cv:: CONFIG proxy.config.snapshot_dir STRING snapshots
-
-   The directory in which Traffic Server stores configuration
-   snapshots on the local system. Unless you specify an absolute
-   path, this directory is located in the Traffic Server ``SYSCONFDIR``
-   directory.
 
 Thread Variables
 ----------------
diff --git a/lib/perl/lib/Apache/TS/AdminClient.pm b/lib/perl/lib/Apache/TS/AdminClient.pm
index 762e4af..920cf71 100644
--- a/lib/perl/lib/Apache/TS/AdminClient.pm
+++ b/lib/perl/lib/Apache/TS/AdminClient.pm
@@ -30,27 +30,29 @@ use Apache::TS;
 
 # Mgmt API command constants, should track ts/mgmtapi.h
 use constant {
-    TS_FILE_READ            => 0,
-    TS_FILE_WRITE           => 1,
-    TS_RECORD_SET           => 2,
-    TS_RECORD_GET           => 3,
-    TS_PROXY_STATE_GET      => 4,
-    TS_PROXY_STATE_SET      => 5,
-    TS_RECONFIGURE          => 6,
-    TS_RESTART              => 7,
-    TS_BOUNCE               => 8,
-    TS_EVENT_RESOLVE        => 9,
-    TS_EVENT_GET_MLT        => 10,
-    TS_EVENT_ACTIVE         => 11,
-    TS_EVENT_REG_CALLBACK   => 12,
-    TS_EVENT_UNREG_CALLBACK => 13,
-    TS_EVENT_NOTIFY         => 14,
-    TS_SNAPSHOT_TAKE        => 15,
-    TS_SNAPSHOT_RESTORE     => 16,
-    TS_SNAPSHOT_REMOVE      => 17,
-    TS_SNAPSHOT_GET_MLT     => 18,
-    TS_DIAGS                => 19,
-    TS_STATS_RESET          => 20
+    TS_FILE_READ                  => 0,
+    TS_FILE_WRITE                 => 1,
+    TS_RECORD_SET                 => 2,
+    TS_RECORD_GET                 => 3,
+    TS_PROXY_STATE_GET            => 4,
+    TS_PROXY_STATE_SET            => 5,
+    TS_RECONFIGURE                => 6,
+    TS_RESTART                    => 7,
+    TS_BOUNCE                     => 8,
+    TS_EVENT_RESOLVE              => 9,
+    TS_EVENT_GET_MLT              => 10,
+    TS_EVENT_ACTIVE               => 11,
+    TS_EVENT_REG_CALLBACK         => 12,
+    TS_EVENT_UNREG_CALLBACK       => 13,
+    TS_EVENT_NOTIFY               => 14,
+    TS_STATS_RESET_NODE           => 15,
+    TS_STORAGE_DEVICE_CMD_OFFLINE => 16,
+    TS_RECORD_MATCH_GET           => 17,
+    TS_API_PING                   => 18,
+    TS_SERVER_BACKTRACE           => 19,
+    TS_RECORD_DESCRIBE_CONFIG     => 20,
+    TS_LIFECYCLE_MESSAGE          => 21,
+    TS_UNDEFINED_OP               => 22
 };
 
 use constant {
@@ -590,7 +592,6 @@ The Apache Traffic Server Administration Manual will explain what these strings
  proxy.config.res_track_memory
  proxy.config.reverse_proxy.enabled
  proxy.config.reverse_proxy.oldasxbehavior
- proxy.config.snapshot_dir
  proxy.config.socks.accept_enabled
  proxy.config.socks.accept_port
  proxy.config.socks.connection_attempts
diff --git a/lib/records/I_RecCore.h b/lib/records/I_RecCore.h
index ff39339..cda8e62 100644
--- a/lib/records/I_RecCore.h
+++ b/lib/records/I_RecCore.h
@@ -54,9 +54,6 @@ std::string RecConfigReadConfigDir();
 // Return a copy of the system's local state directory, taking proxy.config.local_state_dir into account. The
 std::string RecConfigReadRuntimeDir();
 
-// Return a copy of the system's snapshot directory, taking proxy.config.snapshot_dir into account. The caller
-std::string RecConfigReadSnapshotDir();
-
 // Return a copy of the system's log directory, taking proxy.config.log.logfile_dir into account. The caller
 std::string RecConfigReadLogDir();
 
diff --git a/lib/records/RecCore.cc b/lib/records/RecCore.cc
index 5069782..aa2557a 100644
--- a/lib/records/RecCore.cc
+++ b/lib/records/RecCore.cc
@@ -1203,15 +1203,6 @@ RecConfigReadPluginDir()
 }
 
 //-------------------------------------------------------------------------
-// RecConfigReadSnapshotDir.
-//-------------------------------------------------------------------------
-std::string
-RecConfigReadSnapshotDir()
-{
-  return RecConfigReadConfigPath("proxy.config.snapshot_dir", "snapshots");
-}
-
-//-------------------------------------------------------------------------
 // RecConfigReadConfigPath
 //-------------------------------------------------------------------------
 std::string
diff --git a/mgmt/FileManager.cc b/mgmt/FileManager.cc
index 8b4a190..dd6a28b 100644
--- a/mgmt/FileManager.cc
+++ b/mgmt/FileManager.cc
@@ -36,8 +36,6 @@
 #define DIR_MODE S_IRWXU
 #define FILE_MODE S_IRWXU
 
-using snapshot = fileEntry;
-
 FileManager::FileManager()
 {
   bindings = ink_hash_table_create(InkHashTableKeyType_String);
@@ -45,21 +43,6 @@ FileManager::FileManager()
 
   ink_mutex_init(&accessLock);
   ink_mutex_init(&cbListLock);
-
-  ats_scoped_str snapshotDir(RecConfigReadSnapshotDir());
-
-  // Check to see if the directory already exists, if not create it.
-  if (mkdir(snapshotDir, DIR_MODE) < 0 && errno != EEXIST) {
-    // Failed to create the snapshot directory
-    mgmt_fatal(0, "[FileManager::FileManager] Failed to create the snapshot directory %s: %s\n", (const char *)snapshotDir,
-               strerror(errno));
-  }
-
-  if (!ink_file_is_directory(snapshotDir)) {
-    mgmt_fatal(0, "[FileManager::FileManager] snapshot directory %s is not a directory\n", (const char *)snapshotDir);
-  }
-
-  this->dirDescript = "snapshot";
 }
 
 // FileManager::~FileManager
@@ -78,9 +61,6 @@ FileManager::~FileManager()
   // Let other operations finish and do not start any new ones
   ink_mutex_acquire(&accessLock);
 
-  this->managedDir  = nullptr;
-  this->dirDescript = nullptr;
-
   for (cb = cblist.pop(); cb != nullptr; cb = cblist.pop()) {
     delete cb;
   }
@@ -193,419 +173,6 @@ FileManager::fileChanged(const char *fileName, bool incVersion)
   ink_mutex_release(&cbListLock);
 }
 
-// TextBuffer* FileManager::filesManaged()
-//
-//  Returns a comma separated list of all files currently being
-//    managed by this object
-//
-//  CALLEE DELETES the returned space
-TextBuffer *
-FileManager::filesManaged()
-{
-  TextBuffer *result = new TextBuffer(1024);
-  const char *currentName;
-  const char separator[] = "\n";
-  Rollback *rb;
-  InkHashTableEntry *entry;
-  InkHashTableIteratorState iterator_state;
-
-  ink_mutex_acquire(&accessLock);
-  // To get a stable snap shot, we need to get the rollback
-  //   locks on all configuration files so the files
-  //   do not change from under us
-  for (entry = ink_hash_table_iterator_first(bindings, &iterator_state); entry != nullptr;
-       entry = ink_hash_table_iterator_next(bindings, &iterator_state)) {
-    rb          = (Rollback *)ink_hash_table_entry_value(bindings, entry);
-    currentName = rb->getBaseName();
-    ink_assert(currentName);
-
-    result->copyFrom(currentName, strlen(currentName));
-    result->copyFrom(separator, 1);
-  }
-  ink_mutex_release(&accessLock);
-
-  return result;
-}
-
-// void FileManager::doRollbackLocks(lockAction_t action)
-//
-//  Iterates through the Rollback objects we are managing
-//    and performs the parameter specified action on each lock
-//
-//  CALLLEE must hold this->accessLock
-//
-void
-FileManager::doRollbackLocks(lockAction_t action)
-{
-  Rollback *rb;
-  InkHashTableEntry *entry;
-  InkHashTableIteratorState iterator_state;
-
-  for (entry = ink_hash_table_iterator_first(bindings, &iterator_state); entry != nullptr;
-       entry = ink_hash_table_iterator_next(bindings, &iterator_state)) {
-    rb = (Rollback *)ink_hash_table_entry_value(bindings, entry);
-
-    switch (action) {
-    case ACQUIRE_LOCK:
-      rb->acquireLock();
-      break;
-    case RELEASE_LOCK:
-      rb->releaseLock();
-      break;
-    default:
-      ink_assert(0);
-      break;
-    }
-  }
-}
-
-// void FileManager::abortRestore(const char* abortTo)
-//
-//  Iterates through the hash table of managed files
-//    and Rollsback one version until we get to the file
-//    named abortTo
-//
-//  It is a fatal error for any of the Rollbacks to
-//    fail since that leaves the configuration in an
-//    indeterminate state
-//
-//  CALLEE should be holding the locks on all the Rollback
-//    objects
-//
-void
-FileManager::abortRestore(const char *abortTo)
-{
-  Rollback *rb;
-  InkHashTableEntry *entry;
-  InkHashTableIteratorState iterator_state;
-  version_t currentVersion;
-
-  ink_assert(abortTo != nullptr);
-
-  for (entry = ink_hash_table_iterator_first(bindings, &iterator_state); entry != nullptr;
-       entry = ink_hash_table_iterator_next(bindings, &iterator_state)) {
-    rb = (Rollback *)ink_hash_table_entry_value(bindings, entry);
-
-    // We are done
-    if (strcmp(abortTo, rb->getBaseName()) == 0) {
-      return;
-    }
-
-    currentVersion = rb->getCurrentVersion();
-    if (rb->revertToVersion_ml(currentVersion - 1) != OK_ROLLBACK) {
-      mgmt_fatal(0, "[FileManager::abortRestore] Unable to abort a failed snapshot restore.  Configuration files have been "
-                    "left in a inconsistent state\n");
-    }
-  }
-}
-
-// SnapResult FileManager::restoresSnap(const char* snapName)
-//
-//  Restores the snapshot with snapName.
-//
-//  If restoration fails, calls this->abortRestore
-//    to reset the configuraton state
-//
-SnapResult
-FileManager::restoreSnap(const char *snapName, const char *snapDir)
-{
-  Rollback *rb;
-  InkHashTableEntry *entry;
-  InkHashTableIteratorState iterator_state;
-  SnapResult result = SNAP_OK;
-  char *snapPath;
-  char *filePath = nullptr;
-  TextBuffer storage(2048);
-
-  snapPath = newPathString(snapDir, snapName);
-
-  ink_mutex_acquire(&accessLock);
-
-  if (access(snapPath, F_OK) == -1) {
-    delete[] snapPath;
-    ink_mutex_release(&accessLock);
-    return SNAP_NOT_FOUND;
-  }
-
-  // To get a stable restore, we need to get the rollback
-  //   locks on all configuration files so that the active files
-  //   do not change from under us
-  doRollbackLocks(ACQUIRE_LOCK);
-
-  // For each file, load the snap shot file and Roll a new version
-  //    of the active file
-  //
-  for (entry = ink_hash_table_iterator_first(bindings, &iterator_state); entry != nullptr;
-       entry = ink_hash_table_iterator_next(bindings, &iterator_state)) {
-    rb       = (Rollback *)ink_hash_table_entry_value(bindings, entry);
-    filePath = newPathString(snapPath, rb->getBaseName());
-    if (readFile(filePath, &storage) != SNAP_OK) {
-      abortRestore(rb->getBaseName());
-      result = SNAP_FILE_ACCESS_FAILED;
-      break;
-    }
-
-    if (rb->forceUpdate_ml(&storage) != OK_ROLLBACK) {
-      abortRestore(rb->getBaseName());
-      result = SNAP_FILE_ACCESS_FAILED;
-      break;
-    }
-    delete[] filePath;
-    filePath = nullptr;
-    storage.reUse();
-  }
-
-  doRollbackLocks(RELEASE_LOCK);
-  ink_mutex_release(&accessLock);
-
-  if (filePath != nullptr) {
-    delete[] filePath;
-  }
-
-  delete[] snapPath;
-  return result;
-}
-
-// SnapResult FileManager::removeSnap(const char* snapName)
-//
-//
-SnapResult
-FileManager::removeSnap(const char *snapName, const char *snapDir)
-{
-  struct dirent *entryPtr;
-  DIR *dir;
-  char *snapPath;
-  char *snapFilePath;
-  bool unlinkFailed = false;
-  SnapResult result = SNAP_OK;
-  snapPath          = newPathString(snapDir, snapName);
-
-  dir = opendir(snapPath);
-
-  if (dir == nullptr) {
-    mgmt_log("[FileManager::removeSnap] Unable to open snapshot %s: %s\n", snapName, strerror(errno));
-    delete[] snapPath;
-    return SNAP_NOT_FOUND;
-  }
-
-  while ((entryPtr = readdir(dir))) {
-    if (strcmp(".", entryPtr->d_name) == 0 || strcmp("..", entryPtr->d_name) == 0) {
-      continue;
-    }
-
-    snapFilePath = newPathString(snapPath, entryPtr->d_name);
-
-    if (unlink(snapFilePath) < 0) {
-      mgmt_log("[FileManager::removeSnap] Unlink failed for %s: %s\n", snapFilePath, strerror(errno));
-      unlinkFailed = true;
-      result       = SNAP_REMOVE_FAILED;
-    }
-    delete[] snapFilePath;
-  }
-
-  closedir(dir);
-
-  // If we managed to get everything, remove the directory
-  //
-  if (unlinkFailed == false) {
-    if (rmdir(snapPath) < 0) {
-      // strerror() isn't reentrant/thread-safe ... Problem? /leif
-      mgmt_log("[FileManager::removeSnap] Unable to remove snapshot directory %s: %s\n", snapPath, strerror(errno));
-      result = SNAP_REMOVE_FAILED;
-    } else {
-      result = SNAP_OK;
-    }
-  }
-
-  delete[] snapPath;
-  return result;
-}
-
-//
-//  Creates a new snapshot with snapName
-//     Creates a directory named snapName in the snapshot directory
-//     Places a copy of every config file into the new directory
-//
-
-SnapResult
-FileManager::takeSnap(const char *snapName, const char *snapDir)
-{
-  Rollback *rb;
-  InkHashTableEntry *entry;
-  InkHashTableIteratorState iterator_state;
-  char *snapPath;
-  SnapResult callResult = SNAP_OK;
-
-  // Make sure the user sent us a name
-  if (snapName == nullptr || *snapName == '\0') {
-    return SNAP_NO_NAME_GIVEN;
-  }
-
-  if (strchr(snapName, '/') != nullptr) {
-    return SNAP_ILLEGAL_NAME;
-  }
-  // make sure the name is legal and cleaned up
-  if (!checkValidName(snapName)) {
-    return SNAP_ILLEGAL_NAME;
-  }
-
-  snapPath = newPathString(snapDir, snapName);
-
-  if (mkdir(snapPath, DIR_MODE) < 0 && errno != EEXIST) {
-    mgmt_log("[FileManager::takeSnap] Failed to create directory for snapshot %s: %s\n", snapName, strerror(errno));
-    delete[] snapPath;
-    return SNAP_DIR_CREATE_FAILED;
-  }
-
-  if (!ink_file_is_directory(snapPath)) {
-    mgmt_log("[FileManager::takeSnap] snapshot directory %s is not a directory\n", snapPath);
-    delete[] snapPath;
-    return SNAP_DIR_CREATE_FAILED;
-  }
-
-  ink_mutex_acquire(&accessLock);
-
-  // To get a stable snap shot, we need to get the rollback
-  //   locks on all configuration files so the files
-  //   do not change from under us
-  doRollbackLocks(ACQUIRE_LOCK);
-
-  // For each file, make a copy in the snap shot directory
-  for (entry = ink_hash_table_iterator_first(bindings, &iterator_state); entry != nullptr;
-       entry = ink_hash_table_iterator_next(bindings, &iterator_state)) {
-    rb         = (Rollback *)ink_hash_table_entry_value(bindings, entry);
-    callResult = this->copyFile(rb, snapPath);
-    if (callResult != SNAP_OK) {
-      // Remove the failed snapshot so that we do not have a partial
-      //   one hanging around
-      if (removeSnap(snapName, snapDir) != SNAP_OK) {
-        mgmt_log("[FileManager::takeSnap] Unable to remove failed snapshot %s.  This snapshot should be removed by hand\n",
-                 snapName);
-      }
-      break;
-    }
-  }
-
-  // Free all the locks since we are done
-  //
-  doRollbackLocks(RELEASE_LOCK);
-
-  ink_mutex_release(&accessLock);
-  delete[] snapPath;
-  return callResult;
-}
-
-//
-//  SnapResult FileManager::readFile(const char* filePath, TextBuffer* contents)
-//
-//  Reads the specified file into the TextBuffer.  Returns SNAP_OK if
-//    the file was successfully read and an error code otherwise
-//
-SnapResult
-FileManager::readFile(const char *filePath, TextBuffer *contents)
-{
-  int diskFD;
-  int readResult;
-
-  ink_assert(contents != nullptr);
-  diskFD = mgmt_open(filePath, O_RDONLY);
-
-  if (diskFD < 0) {
-    mgmt_log("[FileManager::readFile] Open of snapshot file failed %s: %s\n", filePath, strerror(errno));
-    return SNAP_FILE_ACCESS_FAILED;
-  }
-
-  fcntl(diskFD, F_SETFD, FD_CLOEXEC);
-
-  while ((readResult = contents->readFromFD(diskFD)) > 0) {
-    ;
-  }
-  close(diskFD);
-
-  if (readResult < 0) {
-    mgmt_log("[FileManager::readFile] Read of snapshot file failed %s: %s\n", filePath, strerror(errno));
-    return SNAP_FILE_ACCESS_FAILED;
-  }
-
-  return SNAP_OK;
-}
-
-//  SnapResult FileManager::copyFile(Rollback* rb, const char* snapPath)
-//
-//  Copies a file (represented by Rollback* rb) into a snapshot
-//    directory (snapPath)
-//
-SnapResult
-FileManager::copyFile(Rollback *rb, const char *snapPath)
-{
-  const char *fileName;
-  char *filePath;
-  int diskFD;
-  TextBuffer *copyBuf;
-  SnapResult result;
-
-  fileName = rb->getBaseName();
-
-  // Load the current config into memory
-  //
-  // The Rollback lock is held by CALLEE
-  if (rb->getVersion_ml(rb->getCurrentVersion(), &copyBuf) != OK_ROLLBACK) {
-    mgmt_log("[FileManager::copyFile] Unable to retrieve current version of %s\n", fileName);
-    return SNAP_FILE_ACCESS_FAILED;
-  }
-  // Create the new file
-  filePath = newPathString(snapPath, fileName);
-  diskFD   = mgmt_open_mode(filePath, O_RDWR | O_CREAT, FILE_MODE);
-
-  if (diskFD < 0) {
-    mgmt_log("[FileManager::copyFile] Unable to create snapshot file %s: %s\n", fileName, strerror(errno));
-    delete[] filePath;
-    delete copyBuf;
-    return SNAP_FILE_CREATE_FAILED;
-  }
-
-  fcntl(diskFD, F_SETFD, FD_CLOEXEC);
-
-  // Write the file contents to the copy
-  if (write(diskFD, copyBuf->bufPtr(), copyBuf->spaceUsed()) < 0) {
-    mgmt_log("[FileManager::copyFile] Unable to write snapshot file %s: %s\n", fileName, strerror(errno));
-    result = SNAP_WRITE_FAILED;
-  } else {
-    result = SNAP_OK;
-  }
-
-  delete[] filePath;
-  delete copyBuf;
-  close(diskFD);
-  return result;
-}
-
-// SnapResult FileManager::WalkSnaps(ExpandingArray* snapList)
-//
-//   Iterates through the snapshot directory and adds every snapshot
-//     into the parameter snapList
-//
-//   CALLEE should be holding this->accessLock
-//
-SnapResult
-FileManager::WalkSnaps(ExpandingArray *snapList)
-{
-  MFresult r;
-
-  // Make sure managedDir is the latest from proxy.config.snapshot_dir.
-  this->managedDir = ats_stringdup(RecConfigReadSnapshotDir());
-
-  ink_mutex_acquire(&accessLock);
-
-  r = WalkFiles(snapList);
-  // lmgmt->record_data ->setString("proxy.config.snapshot_dir", managedDir);
-
-  ink_mutex_release(&accessLock);
-  ats_free(this->managedDir);
-  this->managedDir = nullptr;
-  return (SnapResult)r;
-}
-
 // void FileManger::rereadConfig()
 //
 //   Interates through the list of managed files and
@@ -692,58 +259,6 @@ FileManager::isConfigStale()
   return stale;
 }
 
-// void FileManager::displaySnapPage(TextBuffer* output, httpResponse& answerHdr)
-//
-//  Generates an HTML page with the add form and the list
-//    of current snapshots
-//
-void
-FileManager::displaySnapOption(TextBuffer *output)
-{
-  ExpandingArray snap_list(25, true);
-  SnapResult snap_result;
-  int num_snaps;
-
-  snap_result = WalkSnaps(&snap_list);
-  if (snap_result == SNAP_OK) {
-    num_snaps = snap_list.getNumEntries();
-    if (num_snaps > 0) {
-      addSelectOptions(output, &snap_list);
-    }
-  }
-}
-
-// void FileManger::createSelect(char* formVar, TextBuffer* output, ExpandingArray*)
-//
-//  Creats a form with a select list.  The select options come
-//    from the expanding array.  Action is the value for the hidden input
-//    tag with name action
-//
-void
-FileManager::createSelect(char *action, TextBuffer *output, ExpandingArray *options)
-{
-  const char formOpen[]     = "<form method=POST action=\"/configure/snap_action.html\">\n<select name=snap>\n";
-  const char formEnd[]      = "</form>";
-  const char submitButton[] = "<input type=submit value=\"";
-  const char hiddenInput[]  = "<input type=hidden name=action value=";
-
-  int numOptions;
-
-  numOptions = options->getNumEntries();
-
-  if (numOptions > 0) {
-    output->copyFrom(formOpen, strlen(formOpen));
-    addSelectOptions(output, options);
-    output->copyFrom(hiddenInput, strlen(hiddenInput));
-    output->copyFrom(action, strlen(action));
-    output->copyFrom(">\n", 2);
-    output->copyFrom(submitButton, strlen(submitButton));
-    output->copyFrom(action, strlen(action));
-    output->copyFrom("\">\n", 3);
-    output->copyFrom(formEnd, strlen(formEnd));
-  }
-}
-
 // void configFileChild(const char *parent, const char *child)
 //
 // Add child to the bindings with parentRollback
@@ -762,47 +277,3 @@ FileManager::configFileChild(const char *parent, const char *child, unsigned fla
   }
   ink_mutex_release(&accessLock);
 }
-
-// bool checkValidName(const char* name)
-//
-// if the string is invalid, ie. all white spaces or contains "irregular" chars,
-// returns 0 ; returns 1 if valid string
-//
-bool
-FileManager::checkValidName(const char *name)
-{
-  int length = strlen(name);
-
-  for (int i = 0; i < length; i++) {
-    if (!isprint(name[i])) {
-      return false; // invalid - unprintable char
-    }
-    if (!isspace(name[i])) {
-      return true; // has non-white space that is printable
-    }
-  }
-
-  return false; // all white spaces
-}
-
-//  int snapEntryCmpFunc(void* e1, void* e2)
-//
-//  a cmp function for snapshot structs that can
-//     used with qsort
-//
-//  compares c_time
-//
-int
-snapEntryCmpFunc(const void *e1, const void *e2)
-{
-  snapshot *entry1 = (snapshot *)*(void **)e1;
-  snapshot *entry2 = (snapshot *)*(void **)e2;
-
-  if (entry1->c_time > entry2->c_time) {
-    return 1;
-  } else if (entry1->c_time < entry2->c_time) {
-    return -1;
-  } else {
-    return 0;
-  }
-}
diff --git a/mgmt/FileManager.h b/mgmt/FileManager.h
index 44e3563..48f1853 100644
--- a/mgmt/FileManager.h
+++ b/mgmt/FileManager.h
@@ -36,7 +36,6 @@
 #include "ts/ink_hash_table.h"
 #include "ts/List.h"
 #include "Rollback.h"
-#include "MultiFile.h"
 
 class Rollback;
 
@@ -48,22 +47,6 @@ public:
   LINK(callbackListable, link);
 };
 
-// MUST match the ordering MFresult so that we can cast
-//   MFresult to SnapResult
-enum SnapResult {
-  SNAP_OK,
-  SNAP_NO_DIR,
-  SNAP_NOT_FOUND,
-  SNAP_DIR_CREATE_FAILED,
-  SNAP_FILE_CREATE_FAILED,
-  SNAP_FILE_ACCESS_FAILED,
-  SNAP_WRITE_FAILED,
-  SNAP_REMOVE_FAILED,
-  SNAP_INVALID_SUBMISSION,
-  SNAP_NO_NAME_GIVEN,
-  SNAP_ILLEGAL_NAME
-};
-
 enum lockAction_t {
   ACQUIRE_LOCK,
   RELEASE_LOCK,
@@ -95,23 +78,13 @@ class ExpandingArray;
 //  fileChanged(const char* fileName) - called by Rollback objects
 //       when their contents change.  Triggers callbacks to FileCallbackFuncs
 //
-//  filesManaged() - returns a TextBuffer that contains a new line separated
-//       list of call files being managed by the FileManager.  CALLEE
-//       is responsible for deleting the returned object
-//
 //  isConfigStale() - returns whether the in-memory files might be stale
 //       compared to what is on disk.
 //
-//  takeSnap(const char* snapName) - creates a new snapshot with
-//       passed in name
-//
-//  restoreSnap(const char* snapName) - restores the specified snap
-//       shot
-//
 //  rereadConfig() - Checks all managed files to see if they have been
 //       updated
 //  addConfigFileGroup(char* data_str, int data_size) - update config file group infos
-class FileManager : public MultiFile
+class FileManager
 {
 public:
   FileManager();
@@ -120,40 +93,18 @@ public:
   bool getRollbackObj(const char *fileName, Rollback **rbPtr);
   void registerCallback(FileCallbackFunc func);
   void fileChanged(const char *fileName, bool incVersion);
-  TextBuffer *filesManaged();
   void rereadConfig();
   bool isConfigStale();
-  // SnapResult takeSnap(const char* snapName);
-  SnapResult takeSnap(const char *snapName, const char *snapDir);
-  // SnapResult restoreSnap(const char* snapName);
-  SnapResult restoreSnap(const char *snapName, const char *snapDir);
-  // SnapResult removeSnap(const char* snapName);
-  SnapResult removeSnap(const char *snapName, const char *snapDir);
-  void displaySnapOption(TextBuffer *output);
-  SnapResult WalkSnaps(ExpandingArray *snapList);
   void configFileChild(const char *parent, const char *child, unsigned int options);
 
 private:
-  void doRollbackLocks(lockAction_t action);
   ink_mutex accessLock; // Protects bindings hashtable
   ink_mutex cbListLock; // Protects the CallBack List
   DLL<callbackListable> cblist;
   InkHashTable *bindings;
-  // InkHashTable* g_snapshot_directory_ht;
-  SnapResult copyFile(Rollback *rb, const char *snapPath);
-  SnapResult readFile(const char *filePath, TextBuffer *contents);
-  void abortRestore(const char *abortTo);
-  void createSelect(char *action, TextBuffer *output, ExpandingArray *options);
-  void snapErrorResponse(char *action, SnapResult error, TextBuffer *output);
-  void snapSuccessResponse(char *action, TextBuffer *output);
-  void generateRestoreConfirm(char *snapName, TextBuffer *output);
-  bool checkValidName(const char *name);
-  const char *getParentFileName(const char *fileName);
   void addFileHelper(const char *fileName, bool root_access_needed, Rollback *parentRollback, unsigned flags = 0);
 };
 
-int snapEntryCmpFunc(const void *e1, const void *e2);
-
 void initializeRegistry(); // implemented in AddConfigFilesHere.cc
 
 #endif
diff --git a/mgmt/Makefile.am b/mgmt/Makefile.am
index ac03023..ee3ba71 100644
--- a/mgmt/Makefile.am
+++ b/mgmt/Makefile.am
@@ -60,8 +60,6 @@ libmgmt_lm_la_SOURCES = \
   FileManager.h \
   LocalManager.cc \
   LocalManager.h \
-  MultiFile.cc \
-  MultiFile.h \
   Rollback.cc \
   Rollback.h \
   WebMgmtUtils.cc \
diff --git a/mgmt/MultiFile.cc b/mgmt/MultiFile.cc
deleted file mode 100644
index a8b69e4..0000000
--- a/mgmt/MultiFile.cc
+++ /dev/null
@@ -1,241 +0,0 @@
-/** @file
-
-  A brief file description
-
-  @section license License
-
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
- */
-
-#include "ts/ink_platform.h"
-#include "ts/ink_memory.h"
-#include "ts/ink_defs.h"
-#include "ts/ink_assert.h"
-#include "ts/ink_error.h"
-#include "ts/ink_file.h"
-#include "ts/ink_string.h"
-#include "ts/ink_time.h"
-
-#include "MgmtUtils.h"
-#include "MultiFile.h"
-#include "ExpandingArray.h"
-#include "ts/TextBuffer.h"
-#include "WebMgmtUtils.h"
-
-/****************************************************************************
- *
- *  MultiFile.cc - base class to handle reading and displaying config
- *                 files and directories
- *
- *
- ****************************************************************************/
-
-MultiFile::MultiFile()
-{
-  managedDir  = nullptr;
-  dirDescript = nullptr;
-}
-
-// void MultiFile::addTableEntries(ExpandingArray* fileList, TextBuffer* output)
-//
-//   Adds table entries to output from the result of WalkFiles
-//
-void
-MultiFile::addTableEntries(ExpandingArray *fileList, TextBuffer *output)
-{
-  int numFiles = fileList->getNumEntries();
-  fileEntry *current;
-  char *safeName;
-  char dateBuf[64];
-  const char dataOpen[]  = "\t<td>";
-  const char dataClose[] = "</td>\n";
-  const int dataOpenLen  = strlen(dataOpen);
-  const int dataCloseLen = strlen(dataClose);
-
-  for (int i = 0; i < numFiles; i++) {
-    current = (fileEntry *)((*fileList)[i]);
-
-    output->copyFrom("<tr>\n", 5);
-    output->copyFrom(dataOpen, dataOpenLen);
-    safeName = substituteForHTMLChars(current->name);
-    output->copyFrom(safeName, strlen(safeName));
-    delete[] safeName;
-    output->copyFrom(dataClose, dataCloseLen);
-    output->copyFrom(dataOpen, dataOpenLen);
-
-    if (ink_ctime_r(&current->c_time, dateBuf) == nullptr) {
-      ink_strlcpy(dateBuf, "<em>No time-stamp</em>", sizeof(dateBuf));
-    }
-    output->copyFrom(dateBuf, strlen(dateBuf));
-    output->copyFrom(dataClose, dataCloseLen);
-    output->copyFrom("</tr>\n", 6);
-  }
-}
-
-// Mfresult MultiFile::WalkFiles(ExpandingArray* fileList)
-//
-//   Iterates through the managed directory and adds every managed file
-//     into the parameter snapList
-//
-
-MFresult
-MultiFile::WalkFiles(ExpandingArray *fileList)
-{
-  struct dirent *dirEntry;
-  DIR *dir;
-  char *fileName;
-  char *filePath;
-  char *records_config_filePath;
-  struct stat fileInfo;
-  struct stat records_config_fileInfo;
-  fileEntry *fileListEntry;
-
-  if ((dir = opendir(managedDir)) == nullptr) {
-    mgmt_log("[MultiFile::WalkFiles] Unable to open %s directory: %s: %s\n", dirDescript, managedDir, strerror(errno));
-    return MF_NO_DIR;
-  }
-
-  while ((dirEntry = readdir(dir))) {
-    fileName                = dirEntry->d_name;
-    filePath                = newPathString(managedDir, fileName);
-    records_config_filePath = newPathString(filePath, "records.config");
-
-    if (stat(filePath, &fileInfo) < 0) {
-      mgmt_log("[MultiFile::WalkFiles] Stat of a %s failed %s: %s\n", dirDescript, fileName, strerror(errno));
-    } else {
-      if (stat(records_config_filePath, &records_config_fileInfo) < 0) {
-        delete[] filePath;
-        delete[] records_config_filePath;
-        continue;
-      }
-      // Ignore ., .., and any dot files
-      if (*fileName != '.' && isManaged(fileName)) {
-        fileListEntry         = (fileEntry *)ats_malloc(sizeof(fileEntry));
-        fileListEntry->c_time = fileInfo.st_ctime;
-        ink_strlcpy(fileListEntry->name, fileName, sizeof(fileListEntry->name));
-        fileList->addEntry(fileListEntry);
-      }
-    }
-
-    delete[] filePath;
-    delete[] records_config_filePath;
-  }
-
-  closedir(dir);
-
-  fileList->sortWithFunction(fileEntryCmpFunc);
-  return MF_OK;
-}
-
-bool
-MultiFile::isManaged(const char *fileName)
-{
-  if (fileName == nullptr) {
-    return false;
-  } else {
-    return true;
-  }
-}
-
-void
-MultiFile::addSelectOptions(TextBuffer *output, ExpandingArray *options)
-{
-  const char selectEnd[]  = "</select>\n";
-  const char option[]     = "\t<option value='";
-  const int optionLen     = strlen(option);
-  const char option_end[] = "'>";
-  char *safeCurrent;
-
-  int numOptions = options->getNumEntries();
-
-  for (int i = 0; i < numOptions; i++) {
-    output->copyFrom(option, optionLen);
-    safeCurrent = substituteForHTMLChars((char *)((*options)[i]));
-    output->copyFrom(safeCurrent, strlen(safeCurrent));
-    output->copyFrom(option_end, strlen(option_end));
-    output->copyFrom(safeCurrent, strlen(safeCurrent));
-    delete[] safeCurrent;
-    output->copyFrom("\n", 1);
-  }
-  output->copyFrom(selectEnd, strlen(selectEnd));
-}
-
-//  int fileEntryCmpFunc(void* e1, void* e2)
-//
-//  a cmp function for fileEntry structs that can
-//     used with qsort
-//
-//  compares c_time
-//
-int
-fileEntryCmpFunc(const void *e1, const void *e2)
-{
-  fileEntry *entry1 = (fileEntry *)*(void **)e1;
-  fileEntry *entry2 = (fileEntry *)*(void **)e2;
-
-  if (entry1->c_time > entry2->c_time) {
-    return 1;
-  } else if (entry1->c_time < entry2->c_time) {
-    return -1;
-  } else {
-    return 0;
-  }
-}
-
-// char* MultiFile::newPathString(const char* s1, const char* s2)
-//
-//   creates a new string that is composed of s1/s2
-//     Callee is responsible for deleting storage
-//     Method makes sure there is no double slash between s1 and s2
-//     The code is borrowed from ink_filepath_make with dynamic allocation.
-//
-char *
-MultiFile::newPathString(const char *s1, const char *s2)
-{
-  char *newStr;
-  int srcLen; // is the length of the src rootpath
-  int addLen; // maximum total path length
-
-  // Treat null as an empty path.
-  if (!s2) {
-    s2 = "";
-  }
-  addLen = strlen(s2) + 1;
-  if (*s2 == '/') {
-    // If addpath is rooted, then rootpath is unused.
-    newStr = new char[addLen];
-    ink_strlcpy(newStr, s2, addLen);
-    return newStr;
-  }
-  if (!s1 || !*s1) {
-    // If there's no rootpath return the addpath
-    newStr = new char[addLen];
-    ink_strlcpy(newStr, s2, addLen);
-    return newStr;
-  }
-  srcLen = strlen(s1);
-  newStr = new char[srcLen + addLen + 1];
-  ink_assert(newStr != nullptr);
-
-  ink_strlcpy(newStr, s1, addLen);
-  if (newStr[srcLen - 1] != '/') {
-    newStr[srcLen++] = '/';
-  }
-  ink_strlcpy(&newStr[srcLen], s2, addLen - srcLen);
-
-  return newStr;
-}
diff --git a/mgmt/MultiFile.h b/mgmt/MultiFile.h
deleted file mode 100644
index 706cc9a..0000000
--- a/mgmt/MultiFile.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/** @file
-
-  A brief file description
-
-  @section license License
-
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
- */
-
-#ifndef _MULTI_FILE_H_
-#define _MULTI_FILE_H_
-
-/****************************************************************************
- *
- *  MultiFile.h - base class to handle reading and displaying config
- *                 files and directories
- *
- *
- ****************************************************************************/
-
-class ExpandingArray;
-class TextBuffer;
-
-#if defined(NAME_MAX)
-#define FILE_NAME_MAX NAME_MAX
-#else
-#define FILE_NAME_MAX 255
-#endif
-
-struct fileEntry {
-  // XXX Remove this arbitrary filename length limit.
-  char name[FILE_NAME_MAX];
-  time_t c_time;
-};
-
-enum MFresult {
-  MF_OK,
-  MF_NO_DIR,
-};
-
-// class MultiFile
-//
-//  The purpose of this class is to allow Snapshots and
-//    Autoconfig to share common code for reading directories
-//    and displaying editing information
-//
-//  Locking issues are up to the child class
-//  No Virtual Functions.  There is not a reason to for anyone to
-//    use MultiFile* so I'm saving the overhead of virtual tables
-//
-class MultiFile
-{
-public:
-  MultiFile();
-
-protected:
-  MFresult WalkFiles(ExpandingArray *fileList);
-  void addTableEntries(ExpandingArray *fileList, TextBuffer *output);
-  char *newPathString(const char *s1, const char *s2);
-  bool isManaged(const char *fileName);
-  void addSelectOptions(TextBuffer *output, ExpandingArray *options);
-  char *managedDir;
-  const char *dirDescript;
-};
-
-int fileEntryCmpFunc(const void *e1, const void *e2);
-
-#endif
diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index 6868337..5b6410c 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -107,8 +107,6 @@ static const RecordElement RecordsConfig[] =
   ,
   {RECT_CONFIG, "proxy.config.output.logfile.rolling_size_mb", RECD_INT, "100", RECU_DYNAMIC, RR_NULL, RECC_STR, "^0*[1-9][0-9]*$", RECA_NULL}
   ,
-  {RECT_CONFIG, "proxy.config.snapshot_dir", RECD_STRING, "snapshots", RECU_DYNAMIC, RR_REQUIRED, RECC_NULL, nullptr, RECA_NULL}
-  ,
   //# 0 = disable
   {RECT_CONFIG, "proxy.config.res_track_memory", RECD_INT, "0", RECU_RESTART_TS, RR_REQUIRED, RECC_INT,  "[0-2]", RECA_NULL}
   ,
diff --git a/mgmt/WebMgmtUtils.cc b/mgmt/WebMgmtUtils.cc
index b74cc3f..b973af4 100644
--- a/mgmt/WebMgmtUtils.cc
+++ b/mgmt/WebMgmtUtils.cc
@@ -29,7 +29,6 @@
 #include "LocalManager.h"
 #include "MgmtUtils.h"
 #include "WebMgmtUtils.h"
-#include "MultiFile.h"
 #include "ts/Regex.h"
 
 /****************************************************************************
@@ -1236,94 +1235,3 @@ recordRestartCheck(const char *varName)
 
   return false;
 }
-
-//-------------------------------------------------------------------------
-// getFilesInDirectory
-//
-// copied from MultiFiles::WalkFiles - but slightly modified
-// returns -1 if directory does not exit
-// returns 1 if everything is ok
-//-------------------------------------------------------------------------
-int
-getFilesInDirectory(char *managedDir, ExpandingArray *fileList)
-{
-  struct dirent *dirEntry;
-  DIR *dir;
-
-  char *fileName;
-  char *filePath;
-  struct stat fileInfo;
-  //  struct stat records_config_fileInfo;
-  fileEntry *fileListEntry;
-
-  if ((dir = opendir(managedDir)) == nullptr) {
-    mgmt_log("[getFilesInDirectory] Unable to open %s directory: %s\n", managedDir, strerror(errno));
-    return -1;
-  }
-
-  while ((dirEntry = readdir(dir))) {
-    fileName = dirEntry->d_name;
-
-    filePath = newPathString(managedDir, fileName);
-    if (stat(filePath, &fileInfo) < 0) {
-      mgmt_log("[getFilesInDirectory] Stat of a %s failed : %s\n", fileName, strerror(errno));
-    } else {
-      // Ignore ., .., and any dot files
-      if (fileName && *fileName != '.') {
-        fileListEntry         = (fileEntry *)ats_malloc(sizeof(fileEntry));
-        fileListEntry->c_time = fileInfo.st_ctime;
-        ink_strlcpy(fileListEntry->name, fileName, sizeof(fileListEntry->name));
-        fileList->addEntry(fileListEntry);
-      }
-    }
-    delete[] filePath;
-  }
-
-  closedir(dir);
-
-  fileList->sortWithFunction(fileEntryCmpFunc);
-  return 1;
-}
-
-//-------------------------------------------------------------------------
-// newPathString
-//
-// copied from MultiFile::newPathString
-// Note: uses C++ new/delete for memory allocation/deallocation
-//-------------------------------------------------------------------------
-char *
-newPathString(const char *s1, const char *s2)
-{
-  char *newStr;
-  int srcLen; // is the length of the src rootpath
-  int addLen; // maximum total path length
-
-  // Treat null as an empty path.
-  if (!s2) {
-    s2 = "";
-  }
-  addLen = strlen(s2) + 1;
-  if (*s2 == '/') {
-    // If addpath is rooted, then rootpath is unused.
-    newStr = new char[addLen];
-    ink_strlcpy(newStr, s2, addLen);
-    return newStr;
-  }
-  if (!s1 || !*s1) {
-    // If there's no rootpath return the addpath
-    newStr = new char[addLen];
-    ink_strlcpy(newStr, s2, addLen);
-    return newStr;
-  }
-  srcLen = strlen(s1);
-  newStr = new char[srcLen + addLen + 1];
-  ink_assert(newStr != nullptr);
-
-  ink_strlcpy(newStr, s1, srcLen + addLen + 1);
-  if (newStr[srcLen - 1] != '/') {
-    newStr[srcLen++] = '/';
-  }
-  ink_strlcpy(&newStr[srcLen], s2, srcLen + addLen + 1);
-
-  return newStr;
-}
diff --git a/mgmt/WebMgmtUtils.h b/mgmt/WebMgmtUtils.h
index 8ca5c86..4a01ab9 100644
--- a/mgmt/WebMgmtUtils.h
+++ b/mgmt/WebMgmtUtils.h
@@ -113,8 +113,4 @@ bool recordRangeCheck(const char *pattern, const char *value);
 bool recordIPCheck(const char *pattern, const char *value);
 bool recordRestartCheck(const char *varName);
 
-// file management
-int getFilesInDirectory(char *managedDir, ExpandingArray *fileList);
-char *newPathString(const char *s1, const char *s2);
-
 #endif
diff --git a/mgmt/api/APITestCliRemote.cc b/mgmt/api/APITestCliRemote.cc
index df0389f..262f187 100644
--- a/mgmt/api/APITestCliRemote.cc
+++ b/mgmt/api/APITestCliRemote.cc
@@ -72,13 +72,6 @@
  *           prints out the event name whenever an event is signalled
  * unregister: unregisters the generic callback function eventCallbackFn
  *
- * Snapshot Operations:
- * --------------------
- * take_snap:<snap_name> - takes the snapshot snap_name
- * restore_snap:<snap_name> restores the snapshot snap_name
- * remove_snap:<snap_name> - removes the snapshot snap_name
- * snapshots - lists all snapshots in etc/trafficserver/snapshot directory
- *
  * Diags
  * ----
  * diags - uses STATUS, NOTE, FATAL, ERROR diags
@@ -1804,85 +1797,6 @@ unregister_event_callback()
 }
 
 /***************************************************************************
- * Snapshots Testing
- ***************************************************************************/
-
-void
-print_snapshots()
-{
-  TSStringList list;
-  TSMgmtError err;
-  char *name;
-
-  list = TSStringListCreate();
-  err  = TSSnapshotGetMlt(list);
-  print_err("TSSnapshotGetMlt", err);
-
-  printf("All Snapshots:\n");
-  if (err == TS_ERR_OKAY) {
-    int num = TSStringListLen(list);
-    for (int i = 0; i < num; i++) {
-      name = TSStringListDequeue(list);
-      if (name) {
-        printf("%s\n", name);
-      }
-      TSfree(name);
-    }
-  }
-
-  TSStringListDestroy(list);
-  return;
-}
-
-void
-add_snapshot(char *args)
-{
-  char *snap_name;
-
-  strtok(args, ":");
-  snap_name = strtok(nullptr, ":");
-  fprintf(stderr, "add snapshot: %s\n", snap_name);
-  char *name = TSstrdup(snap_name);
-
-  TSMgmtError err = TSSnapshotTake(name);
-  print_err("TSSnapshotTake", err);
-
-  TSfree(name);
-}
-
-void
-remove_snapshot(char *args)
-{
-  char *snap_name;
-
-  strtok(args, ":");
-  snap_name = strtok(nullptr, ":");
-  fprintf(stderr, "remove snapshot: %s\n", snap_name);
-  char *name = TSstrdup(snap_name);
-
-  TSMgmtError err = TSSnapshotRemove(name);
-  print_err("TSSnapshotRemove", err);
-
-  TSfree(name);
-}
-
-void
-restore_snapshot(char *args)
-{
-  char *snap_name;
-
-  strtok(args, ":");
-  snap_name = strtok(nullptr, ":");
-  fprintf(stderr, "resotre snapshot: %s\n", snap_name);
-  char *name = TSstrdup(snap_name);
-
-  TSMgmtError err = TSSnapshotRestore(name);
-  print_err("TSSnapshotRestore", err);
-
-  TSfree(name);
-}
-
-/***************************************************************************
  * Statistics
  ***************************************************************************/
 
@@ -2063,14 +1977,6 @@ runInteractive()
       register_event_callback();
     } else if (strstr(buf, "unregister")) {
       unregister_event_callback();
-    } else if (strstr(buf, "snapshots")) {
-      print_snapshots();
-    } else if (strstr(buf, "take_snap")) {
-      add_snapshot(buf);
-    } else if (strstr(buf, "remove_snap")) {
-      remove_snapshot(buf);
-    } else if (strstr(buf, "restore_snap")) {
-      restore_snapshot(buf);
     } else if (strstr(buf, "read_url")) {
       test_read_url(true);
     } else if (strstr(buf, "test_url")) {
diff --git a/mgmt/api/CoreAPI.cc b/mgmt/api/CoreAPI.cc
index 6a8a485..d3977e0 100644
--- a/mgmt/api/CoreAPI.cc
+++ b/mgmt/api/CoreAPI.cc
@@ -951,91 +951,6 @@ EventSignalCbUnregister(const char *event_name, TSEventSignalFunc func)
   return cb_table_unregister(local_event_callbacks, event_name, func);
 }
 
-/***************************************************************************
- * Snapshots
- ***************************************************************************/
-TSMgmtError
-SnapshotTake(const char *snapshot_name)
-{
-  ats_scoped_str snapdir;
-
-  if (!snapshot_name) {
-    return TS_ERR_PARAMS;
-  }
-
-  snapdir = RecConfigReadSnapshotDir();
-
-  SnapResult result = configFiles->takeSnap(snapshot_name, snapdir);
-  if (result != SNAP_OK) {
-    return TS_ERR_FAIL;
-  } else {
-    return TS_ERR_OKAY;
-  }
-}
-
-TSMgmtError
-SnapshotRestore(const char *snapshot_name)
-{
-  ats_scoped_str snapdir;
-
-  if (!snapshot_name) {
-    return TS_ERR_PARAMS;
-  }
-
-  snapdir = RecConfigReadSnapshotDir();
-
-  SnapResult result = configFiles->restoreSnap(snapshot_name, snapdir);
-  if (result != SNAP_OK) {
-    return TS_ERR_FAIL;
-  } else {
-    return TS_ERR_OKAY;
-  }
-}
-
-TSMgmtError
-SnapshotRemove(const char *snapshot_name)
-{
-  ats_scoped_str snapdir;
-
-  if (!snapshot_name) {
-    return TS_ERR_PARAMS;
-  }
-
-  snapdir = RecConfigReadSnapshotDir();
-
-  SnapResult result = configFiles->removeSnap(snapshot_name, snapdir);
-  if (result != SNAP_OK) {
-    return TS_ERR_FAIL;
-  } else {
-    return TS_ERR_OKAY;
-  }
-}
-
-/* based on FileManager.cc::displaySnapOption() */
-TSMgmtError
-SnapshotGetMlt(LLQ *snapshots)
-{
-  ExpandingArray snap_list(25, true);
-  SnapResult snap_result;
-  int num_snaps;
-  char *snap_name;
-
-  snap_result = configFiles->WalkSnaps(&snap_list);
-  if (snap_result != SNAP_OK) {
-    return TS_ERR_FAIL;
-  }
-
-  num_snaps = snap_list.getNumEntries();
-  for (int i = 0; i < num_snaps; i++) {
-    snap_name = (char *)(snap_list[i]);
-    if (snap_name) {
-      enqueue(snapshots, ats_strdup(snap_name));
-    }
-  }
-
-  return TS_ERR_OKAY;
-}
-
 /*-------------------------------------------------------------------------
  * StatsReset
  *-------------------------------------------------------------------------
diff --git a/mgmt/api/CoreAPI.h b/mgmt/api/CoreAPI.h
index be6de7e..9b8c45e 100644
--- a/mgmt/api/CoreAPI.h
+++ b/mgmt/api/CoreAPI.h
@@ -83,14 +83,6 @@ TSMgmtError EventIsActive(const char *event_name, bool *is_current);
 TSMgmtError EventSignalCbRegister(const char *event_name, TSEventSignalFunc func, void *data);
 TSMgmtError EventSignalCbUnregister(const char *event_name, TSEventSignalFunc func);
 
-/***************************************************************************
- * Snapshots
- ***************************************************************************/
-TSMgmtError SnapshotTake(const char *snapshot_name);
-TSMgmtError SnapshotRestore(const char *snapshot_name);
-TSMgmtError SnapshotRemove(const char *snapshot_name);
-TSMgmtError SnapshotGetMlt(LLQ *snapshots);
-
 TSMgmtError StatsReset(const char *name = NULL);
 
 #endif
diff --git a/mgmt/api/CoreAPIRemote.cc b/mgmt/api/CoreAPIRemote.cc
index 1f012d5..eda26e9 100644
--- a/mgmt/api/CoreAPIRemote.cc
+++ b/mgmt/api/CoreAPIRemote.cc
@@ -1073,52 +1073,6 @@ EventSignalCbUnregister(const char *event_name, TSEventSignalFunc func)
   return TS_ERR_OKAY;
 }
 
-/***************************************************************************
- * Snapshots
- ***************************************************************************/
-static TSMgmtError
-snapshot_message(OpType op, const char *snapshot_name)
-{
-  TSMgmtError ret;
-  OpType optype           = op;
-  MgmtMarshallString name = const_cast<MgmtMarshallString>(snapshot_name);
-
-  if (!snapshot_name) {
-    return TS_ERR_PARAMS;
-  }
-
-  ret = MGMTAPI_SEND_MESSAGE(main_socket_fd, op, &optype, &name);
-  return (ret == TS_ERR_OKAY) ? parse_generic_response(op, main_socket_fd) : ret;
-}
-
-TSMgmtError
-SnapshotTake(const char *snapshot_name)
-{
-  return snapshot_message(OpType::SNAPSHOT_TAKE, snapshot_name);
-}
-
-TSMgmtError
-SnapshotRestore(const char *snapshot_name)
-{
-  return snapshot_message(OpType::SNAPSHOT_RESTORE, snapshot_name);
-}
-
-TSMgmtError
-SnapshotRemove(const char *snapshot_name)
-{
-  return snapshot_message(OpType::SNAPSHOT_REMOVE, snapshot_name);
-}
-
-TSMgmtError
-SnapshotGetMlt(LLQ *snapshots)
-{
-  if (!snapshots) {
-    return TS_ERR_PARAMS;
-  }
-
-  return send_and_parse_list(OpType::SNAPSHOT_GET_MLT, snapshots);
-}
-
 TSMgmtError
 StatsReset(const char *stat_name)
 {
diff --git a/mgmt/api/EventControlMain.cc b/mgmt/api/EventControlMain.cc
index d08652e..78c6b5a 100644
--- a/mgmt/api/EventControlMain.cc
+++ b/mgmt/api/EventControlMain.cc
@@ -534,10 +534,6 @@ static const event_message_handler handlers[] = {
   handle_event_reg_callback,   // EVENT_REG_CALLBACK
   handle_event_unreg_callback, // EVENT_UNREG_CALLBACK
   nullptr,                     // EVENT_NOTIFY
-  nullptr,                     // SNAPSHOT_TAKE
-  nullptr,                     // SNAPSHOT_RESTORE
-  nullptr,                     // SNAPSHOT_REMOVE
-  nullptr,                     // SNAPSHOT_GET_MLT
   nullptr,                     // DIAGS
   nullptr,                     // STATS_RESET_NODE
   nullptr,                     // STORAGE_DEVICE_CMD_OFFLINE
diff --git a/mgmt/api/INKMgmtAPI.cc b/mgmt/api/INKMgmtAPI.cc
index f2be0bf..9016d0d 100644
--- a/mgmt/api/INKMgmtAPI.cc
+++ b/mgmt/api/INKMgmtAPI.cc
@@ -2079,31 +2079,6 @@ END:
   return err;
 }
 
-/*--- snapshot operations -------------------------------------------------*/
-tsapi TSMgmtError
-TSSnapshotTake(char *snapshot_name)
-{
-  return SnapshotTake(snapshot_name);
-}
-
-tsapi TSMgmtError
-TSSnapshotRestore(char *snapshot_name)
-{
-  return SnapshotRestore(snapshot_name);
-}
-
-tsapi TSMgmtError
-TSSnapshotRemove(char *snapshot_name)
-{
-  return SnapshotRemove(snapshot_name);
-}
-
-tsapi TSMgmtError
-TSSnapshotGetMlt(TSStringList snapshots)
-{
-  return SnapshotGetMlt((LLQ *)snapshots);
-}
-
 /*--- events --------------------------------------------------------------*/
 tsapi TSMgmtError
 TSEventSignal(char *event_name, ...)
diff --git a/mgmt/api/NetworkMessage.cc b/mgmt/api/NetworkMessage.cc
index 1a5b77e..033dbdd 100644
--- a/mgmt/api/NetworkMessage.cc
+++ b/mgmt/api/NetworkMessage.cc
@@ -54,10 +54,6 @@ static const struct NetCmdOperation requests[] = {
   /* EVENT_UNREG_CALLBACK       */ {2, {MGMT_MARSHALL_INT, MGMT_MARSHALL_STRING}},
   /* EVENT_NOTIFY               */ {3, {MGMT_MARSHALL_INT, MGMT_MARSHALL_STRING, MGMT_MARSHALL_STRING}}, // only msg sent from TM to
                                                                                                          // client
-  /* SNAPSHOT_TAKE              */ {2, {MGMT_MARSHALL_INT, MGMT_MARSHALL_STRING}},
-  /* SNAPSHOT_RESTORE           */ {2, {MGMT_MARSHALL_INT, MGMT_MARSHALL_STRING}},
-  /* SNAPSHOT_REMOVE            */ {2, {MGMT_MARSHALL_INT, MGMT_MARSHALL_STRING}},
-  /* SNAPSHOT_GET_MLT           */ {1, {MGMT_MARSHALL_INT}},
   /* STATS_RESET_NODE           */ {2, {MGMT_MARSHALL_INT, MGMT_MARSHALL_STRING}},
   /* STORAGE_DEVICE_CMD_OFFLINE */ {2, {MGMT_MARSHALL_INT, MGMT_MARSHALL_STRING}},
   /* RECORD_MATCH_GET           */ {2, {MGMT_MARSHALL_INT, MGMT_MARSHALL_STRING}},
@@ -85,10 +81,6 @@ static const struct NetCmdOperation responses[] = {
   /* EVENT_REG_CALLBACK         */ {0, {}}, // no reply
   /* EVENT_UNREG_CALLBACK       */ {0, {}}, // no reply
   /* EVENT_NOTIFY               */ {0, {}}, // no reply
-  /* SNAPSHOT_TAKE              */ {1, {MGMT_MARSHALL_INT}},
-  /* SNAPSHOT_RESTORE           */ {1, {MGMT_MARSHALL_INT}},
-  /* SNAPSHOT_REMOVE            */ {1, {MGMT_MARSHALL_INT}},
-  /* SNAPSHOT_GET_MLT           */ {2, {MGMT_MARSHALL_INT, MGMT_MARSHALL_STRING}},
   /* STATS_RESET_NODE           */ {1, {MGMT_MARSHALL_INT}},
   /* STORAGE_DEVICE_CMD_OFFLINE */ {1, {MGMT_MARSHALL_INT}},
   /* RECORD_MATCH_GET           */
@@ -208,9 +200,6 @@ send_mgmt_error(int fd, OpType optype, TSMgmtError error)
   case OpType::PROXY_STATE_SET:
   case OpType::RECONFIGURE:
   case OpType::RESTART:
-  case OpType::SNAPSHOT_REMOVE:
-  case OpType::SNAPSHOT_RESTORE:
-  case OpType::SNAPSHOT_TAKE:
   case OpType::STATS_RESET_NODE:
   case OpType::STORAGE_DEVICE_CMD_OFFLINE:
     ink_release_assert(responses[static_cast<unsigned>(optype)].nfields == 1);
@@ -223,7 +212,6 @@ send_mgmt_error(int fd, OpType optype, TSMgmtError error)
     return send_mgmt_response(fd, optype, &ecode, &intval);
 
   case OpType::EVENT_GET_MLT:
-  case OpType::SNAPSHOT_GET_MLT:
   case OpType::SERVER_BACKTRACE:
     ink_release_assert(responses[static_cast<unsigned>(optype)].nfields == 2);
     return send_mgmt_response(fd, optype, &ecode, &strval);
diff --git a/mgmt/api/NetworkMessage.h b/mgmt/api/NetworkMessage.h
index d9f55ba..bbbd0a2 100644
--- a/mgmt/api/NetworkMessage.h
+++ b/mgmt/api/NetworkMessage.h
@@ -48,10 +48,6 @@ enum class OpType : MgmtMarshallInt {
   EVENT_REG_CALLBACK,
   EVENT_UNREG_CALLBACK,
   EVENT_NOTIFY, /* only msg sent from TM to client */
-  SNAPSHOT_TAKE,
-  SNAPSHOT_RESTORE,
-  SNAPSHOT_REMOVE,
-  SNAPSHOT_GET_MLT,
   STATS_RESET_NODE,
   STORAGE_DEVICE_CMD_OFFLINE,
   RECORD_MATCH_GET,
diff --git a/mgmt/api/TSControlMain.cc b/mgmt/api/TSControlMain.cc
index 6d59afc..4931095 100644
--- a/mgmt/api/TSControlMain.cc
+++ b/mgmt/api/TSControlMain.cc
@@ -807,101 +807,6 @@ done:
 }
 
 /**************************************************************************
- * handle_snapshot
- *
- * purpose: handles request to take/remove/restore a snapshot
- * output: TS_ERR_xx
- *************************************************************************/
-static TSMgmtError
-handle_snapshot(int fd, void *req, size_t reqlen)
-{
-  OpType optype;
-  MgmtMarshallString name = nullptr;
-
-  MgmtMarshallInt err;
-
-  err = recv_mgmt_request(req, reqlen, OpType::SNAPSHOT_TAKE, &optype, &name);
-  if (err != TS_ERR_OKAY) {
-    goto done;
-  }
-
-  if (strlen(name) == 0) {
-    err = TS_ERR_PARAMS;
-    goto done;
-  }
-
-  // call CoreAPI call on Traffic Manager side
-  switch (optype) {
-  case OpType::SNAPSHOT_TAKE:
-    err = SnapshotTake(name);
-    break;
-  case OpType::SNAPSHOT_RESTORE:
-    err = SnapshotRestore(name);
-    break;
-  case OpType::SNAPSHOT_REMOVE:
-    err = SnapshotRemove(name);
-    break;
-  default:
-    err = TS_ERR_FAIL;
-    break;
-  }
-
-done:
-  ats_free(name);
-  return send_mgmt_response(fd, (OpType)optype, &err);
-}
-
-/**************************************************************************
- * handle_snapshot_get_mlt
- *
- * purpose: handles request to get list of snapshots
- * output: TS_ERR_xx
- * note: the req should be the event name
- *************************************************************************/
-static TSMgmtError
-handle_snapshot_get_mlt(int fd, void *req, size_t reqlen)
-{
-  LLQ *snap_list = create_queue();
-  char buf[MAX_BUF_SIZE];
-  char *snap_name;
-  int buf_pos = 0;
-
-  MgmtMarshallInt optype;
-  MgmtMarshallInt err;
-  MgmtMarshallString list = nullptr;
-
-  err = recv_mgmt_request(req, reqlen, OpType::SNAPSHOT_GET_MLT, &optype);
-  if (err != TS_ERR_OKAY) {
-    goto done;
-  }
-
-  // call CoreAPI call on Traffic Manager side; req == event_name
-  err = SnapshotGetMlt(snap_list);
-  if (err != TS_ERR_OKAY) {
-    goto done;
-  }
-
-  // iterate through list and put into a delimited string list
-  memset(buf, 0, MAX_BUF_SIZE);
-  while (!queue_is_empty(snap_list)) {
-    snap_name = (char *)dequeue(snap_list);
-    if (snap_name) {
-      snprintf(buf + buf_pos, (MAX_BUF_SIZE - buf_pos), "%s%c", snap_name, REMOTE_DELIM);
-      buf_pos += (strlen(snap_name) + 1);
-      ats_free(snap_name); // free the llq entry
-    }
-  }
-  buf[buf_pos] = '\0'; // end the string
-
-  // Point the send list to the filled buffer.
-  list = buf;
-
-done:
-  delete_queue(snap_list);
-  return send_mgmt_response(fd, OpType::SNAPSHOT_GET_MLT, &err, &list);
-}
-
-/**************************************************************************
  * handle_stats_reset
  *
  * purpose: handles request to reset statistics to default values
@@ -1133,10 +1038,6 @@ static const control_message_handler handlers[] = {
   /* EVENT_REG_CALLBACK         */ {0, nullptr},
   /* EVENT_UNREG_CALLBACK       */ {0, nullptr},
   /* EVENT_NOTIFY               */ {0, nullptr},
-  /* SNAPSHOT_TAKE              */ {MGMT_API_PRIVILEGED, handle_snapshot},
-  /* SNAPSHOT_RESTORE           */ {MGMT_API_PRIVILEGED, handle_snapshot},
-  /* SNAPSHOT_REMOVE            */ {MGMT_API_PRIVILEGED, handle_snapshot},
-  /* SNAPSHOT_GET_MLT           */ {0, handle_snapshot_get_mlt},
   /* STATS_RESET_NODE           */ {MGMT_API_PRIVILEGED, handle_stats_reset},
   /* STORAGE_DEVICE_CMD_OFFLINE */ {MGMT_API_PRIVILEGED, handle_storage_device_cmd_offline},
   /* RECORD_MATCH_GET           */ {0, handle_record_match},
diff --git a/mgmt/api/include/mgmtapi.h b/mgmt/api/include/mgmtapi.h
index 8d09b88..263d775 100644
--- a/mgmt/api/include/mgmtapi.h
+++ b/mgmt/api/include/mgmtapi.h
@@ -905,31 +905,6 @@ tsapi TSMgmtError TSReadFromUrl(char *url, char **header, int *headerSize, char
  */
 tsapi TSMgmtError TSReadFromUrlEx(const char *url, char **header, int *headerSize, char **body, int *bodySize, int timeout);
 
-/*--- snapshot operations -------------------------------------------------*/
-/* TSSnapshotTake: takes snapshot of configuration at that instant in time
- * Input:  snapshot_name - name to call new snapshot
- * Output: TSMgmtError
- */
-tsapi TSMgmtError TSSnapshotTake(char *snapshot_name);
-
-/* TSSnapshotRestore: restores configuration to when the snapshot was taken
- * Input:  snapshot_name - name of snapshot to restore
- * Output: TSMgmtError
- */
-tsapi TSMgmtError TSSnapshotRestore(char *snapshot_name);
-
-/* TSSnapshotRemove: removes the snapshot
- * Input:  snapshot_name - name of snapshot to remove
- * Output: TSMgmtError
- */
-tsapi TSMgmtError TSSnapshotRemove(char *snapshot_name);
-
-/* TSSnapshotsGet: restores configuration to when the snapshot was taken
- * Input:  snapshots - the list which will store all snapshot names currently taken
- * Output: TSMgmtError
- */
-tsapi TSMgmtError TSSnapshotGetMlt(TSStringList snapshots);
-
 /*--- statistics operations -----------------------------------------------*/
 /* TSStatsReset: sets all the statistics variables to their default values
  * Outpue: TSErrr

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <commits@trafficserver.apache.org>'].

Mime
View raw message