521dad5888fde0e10237c9c6b741e071cd0c5cee
angie
  Tue May 14 09:47:56 2019 -0700
hgSession: added CGI param hgS_sessionDataDbSuffix to randomize choice of customData db* when bulk-converting old saved sessions to use sessionDataDir/sessionDataDbPrefix.  refs #22440

diff --git src/hg/hgSession/hgSession.h src/hg/hgSession/hgSession.h
index b455025..3e6bd9a 100644
--- src/hg/hgSession/hgSession.h
+++ src/hg/hgSession/hgSession.h
@@ -40,50 +40,55 @@
 #define hgsDoLoadLocal hgSessionPrefix "doLoadLocal"
 
 #define hgsLoadUrlName hgSessionPrefix "loadUrlName"
 #define hgsDoLoadUrl hgSessionPrefix "doLoadUrl"
 
 #define hgsDoMainPage hgSessionPrefix "doMainPage"
 
 #define hgsDoSessionDetail hgSessionPrefix "doSessionDetail"
 #define hgsOldSessionName hgSessionPrefix "oldSessionName"
 #define hgsDoSessionChange hgSessionPrefix "doSessionChange"
 
 #define hgsCancel hgSessionPrefix "cancel"
 
 #define hgsDo hgSessionPrefix "do"
 
+// Back-door CGI param to randomize the suffix (usually day of month) for sessionDataDbPrefix.
+// This is for bulk re-saving old sessions to move files and tables to safe storage;
+// we don't want all of the old sessions' tables to end up in the same day-of-month database.
+#define hgsSessionDataDbSuffix hgSessionPrefix "sessionDataDbSuffix"
+
 char *cgiDecodeClone(char *encStr);
 /* Allocate and return a CGI-decoded copy of encStr. */
 
 void startBackgroundWork(char *exec, char **pWorkUrl);
 /* deal with forking off child for background work
  * and setting up the trash file for communicating
  * from the child to the browser */
 
 void getBackgroundStatus(char *url);
 /* fetch status as the latest complete html block available.
  * fetch progress info instead if background proc still running. */
 
 // -----  htmlOpen 
 
 void htmlOpen(char *format, ...);
 /* Start up a page that will be in html format. */
 
 void htmlClose();
 /* Close down html format page. */
 
 void showDownloadSessionCtData(struct hashEl *downloadList);
 /* Show download page for the given session */
 
 void makeDownloadSessionCtData(char *param1, char *backgroundProgress);
 /* Download tables and data to save save in compressed archive. */
 
 void doDownloadSessionCtData(struct hashEl *downloadPathList);
 /* Download given table to browser to save. */
 
-void saveSessionData(struct cart *cart, char *encUserName, char *encSessionName);
+void saveSessionData(struct cart *cart, char *encUserName, char *encSessionName, char *dbSuffix);
 /* If hg.conf specifies safe places to store files and/or tables that belong to user sessions,
  * then scan cart for trashDir files and/or customTrash tables, store them in safe locations,
  * and update cart to point to the new locations. */
 
 #endif /* HGSESSION_H */