Commit f5be016d authored by John Esmet's avatar John Esmet Committed by Yoni Fogel

fixes #5282 only do txn related operations if a txn exists. note that the ydb...

fixes #5282 only do txn related operations if a txn exists. note that the ydb layer properly handles change descriptor in a txnless environment.


git-svn-id: file:///svn/toku/tokudb@45958 c7de825b-a66e-492c-adef-691d508d4ae1
parent f48d3b9f
...@@ -3085,13 +3085,12 @@ toku_ft_change_descriptor( ...@@ -3085,13 +3085,12 @@ toku_ft_change_descriptor(
{ {
int r = 0; int r = 0;
DESCRIPTOR_S new_d; DESCRIPTOR_S new_d;
// if running with txns, save to rollback + write to recovery log
if (txn) {
// put information into rollback file
BYTESTRING old_desc_bs = { old_descriptor->size, (char *) old_descriptor->data }; BYTESTRING old_desc_bs = { old_descriptor->size, (char *) old_descriptor->data };
BYTESTRING new_desc_bs = { new_descriptor->size, (char *) new_descriptor->data }; BYTESTRING new_desc_bs = { new_descriptor->size, (char *) new_descriptor->data };
if (!txn) {
r = EINVAL;
goto cleanup;
}
// put information into rollback file
r = toku_logger_save_rollback_change_fdescriptor( r = toku_logger_save_rollback_change_fdescriptor(
txn, txn,
toku_cachefile_filenum(ft_h->ft->cf), toku_cachefile_filenum(ft_h->ft->cf),
...@@ -3114,6 +3113,7 @@ toku_ft_change_descriptor( ...@@ -3114,6 +3113,7 @@ toku_ft_change_descriptor(
); );
if (r != 0) { goto cleanup; } if (r != 0) { goto cleanup; }
} }
}
// write new_descriptor to header // write new_descriptor to header
new_d.dbt = *new_descriptor; new_d.dbt = *new_descriptor;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment