Rework the checkpoint record format to include a version vector.
[bluesky.git] / bluesky / bluesky-private.h
index f945a93..20079da 100644 (file)
@@ -207,6 +207,12 @@ void bluesky_file_drop_cached(BlueSkyInode *inode);
  * various pieces of data (both where in the cloud and where cached locally).
  * */
 
+/* Eventually we'll want to support multiple writers.  But for now, hard-code
+ * separate namespaces in the cloud for the proxy and the cleaner to write to.
+ * */
+#define BLUESKY_CLOUD_DIR_PRIMARY 0
+#define BLUESKY_CLOUD_DIR_CLEANER 1
+
 typedef struct {
     char bytes[16];
 } BlueSkyCloudID;
@@ -319,6 +325,12 @@ struct BlueSkyCloudLogState {
     GList *inode_list;
     GSList *writeback_list;     // Items which are being serialized right now
     GList *pending_segments;    // Segments which are being uploaded now
+
+    /* What is the most recent sequence number written by the cleaner which we
+     * have processed and incorporated into our own log?  This gets
+     * incorporated into the version vector written out with our checkpoint
+     * records. */
+    int latest_cleaner_seq_seen;
 };
 
 gboolean bluesky_cloudlog_equal(gconstpointer a, gconstpointer b);