Details
-
Improvement
-
Resolution: Fixed
-
Major
-
feature-backlog
-
Security Level: Public
-
None
-
ForestDB: Oct 26 - Nov 13
Description
In some cases, an application wants to retain the stale data up to a given snapshot marker that corresponds to one of the commit headers in a database file. For this, the following new APIs should be provided:
typedef struct
{ fdb_seqnum_t seqnum; // committed sequence number for a given KV store. const char *kv_store_name; // NULL-terminated KV store name }fdb_kvs_commit_marker_t;
/*
- fdb_snapshot_marker_t is an opaque file-level snapshot marker that can be used to purge the stale data up to a given snapshot marker.
*/
typedef structUnknown macro: { fdb_snapshot_marker_t marker; // opaque file-level snapshot marker uint64_t num_kvs_markers; // number of elements in the array below fdb_kvs_commit_marker_t *kvs_markers; // pointer to an array of {seqnum, kv_store_name} pairs };
} fdb_snapshot_info_t;
/**
- Return all the snapshot markers in a given database file.
*/
fdb_status fdb_get_all_snap_markers(fdb_file_handle *fhandle, fdb_snapshot_info_t **markers, int *size);
/**
- Compact the database file by retaining the stale data up to a given file-level snapshot marker.
*/
fdb_status fdb_compact_upto(fdb_file_handle *fhandle,
const char *new_filename,
fdb_snapshot_marker_t marker);
Attachments
For Gerrit Dashboard: MB-12542 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
45828,4 | MB-12542: Ensure snapshot stats get populated in _fdb_open | master | forestdb | Status: ABANDONED | 0 | 0 |
45943,2 | MB-12542: Ensure snapshot stats get populated in _fdb_open | master | forestdb | Status: MERGED | +2 | +1 |
45948,6 | MB-12542: Add a new API fdb_get_all_snap_markers() | master | forestdb | Status: MERGED | +2 | +1 |
46091,3 | MB-12542: Add fdb_compact_upto() to control purging of stale data | master | forestdb | Status: ABANDONED | 0 | 0 |
46149,6 | MB-12542: New Api fdb_compact_upto() to control purge of stale data | master | forestdb | Status: MERGED | +2 | +1 |