Skip to content

Commit acdd73e

Browse files
do not allow parallel flushing of snapshot md clusters since both md types are implicitly in linked list format
1 parent 52b6570 commit acdd73e

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

lib/blob/blobstore.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -14102,7 +14102,8 @@ blob_search_for_new_flush_job(struct spdk_blob *blob, struct t_flush_job *job) {
1410214102
++blob->current_array_ordinal;
1410314103
blob->next_idx_in_array = blob->active.extent_pages_array_size - 1; // next array is extent pages array
1410414104
}
14105-
} else if (blob->current_array_ordinal <= 2) {
14105+
} else if (blob->current_array_ordinal <= 2 && blob->nflush_jobs_current == 0) // no parallelism allowed on md
14106+
{
1410614107
job->is_md_job = true;
1410714108

1410814109
uint32_t *page_idxs_arr = blob->current_array_ordinal == 1 ? blob->active.extent_pages : blob->active.pages;
@@ -14127,6 +14128,10 @@ blob_search_for_new_flush_job(struct spdk_blob *blob, struct t_flush_job *job) {
1412714128
++blob->current_array_ordinal;
1412814129
blob->next_idx_in_array = blob->active.num_pages - 1; // next array after extent pages array is pages array
1412914130
}
14131+
} else if (job->buf) // job will never be done again, free its buffer to save memory
14132+
{
14133+
spdk_free(job->buf);
14134+
job->buf = NULL;
1413014135
}
1413114136
}
1413214137
return 0;

lib/blob/blobstore.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,8 @@ struct spdk_blob {
204204
are on the same array to safely flush data before metadata and less
205205
sensitive metadata before other metadata.
206206
207-
However, the very first non-extent page must be the last md page to be flushed.
208-
For convenience sake, we'll just flush both types of md pages in reverse order.
207+
However, extent pages and md pages are implicitly ordered like a linked list, so
208+
we must flush them one md cluster at a time in reverse order.
209209
*/
210210
uint64_t next_idx_in_array;
211211

0 commit comments

Comments
 (0)