[TDB-20] With checkpoint disabled, closing FT file still rotates header#383
Open
Jun-Yuan wants to merge 1 commit intopercona:masterfrom
Open
[TDB-20] With checkpoint disabled, closing FT file still rotates header#383Jun-Yuan wants to merge 1 commit intopercona:masterfrom
Jun-Yuan wants to merge 1 commit intopercona:masterfrom
Conversation
laurynas-biveinis
suggested changes
Sep 5, 2017
Contributor
laurynas-biveinis
left a comment
There was a problem hiding this comment.
Formatting comments only
ft/cachetable/cachetable-internal.h
Outdated
| KIBBUTZ client_kibbutz; // pool of worker threads and jobs to do asynchronously for the client. | ||
| KIBBUTZ ct_kibbutz; // pool of worker threads and jobs to do asynchronously for the cachetable | ||
| KIBBUTZ checkpointing_kibbutz; // small pool for checkpointing cloned pairs | ||
| //bool in_backup; // we are in back up or NOT, default is false |
Contributor
There was a problem hiding this comment.
Please no commented-out code?
ft/ft.cc
Outdated
|
|
||
|
|
||
| // maps to cf->note_pin_by_backup | ||
| //Must be protected by ydb lock. |
ft/ft.cc
Outdated
| // Requires: the reflock is held. | ||
| static void unpin_by_backup_callback(FT ft, void *extra) { | ||
| invariant(extra == NULL); | ||
| invariant(ft->num_backups>0); |
ft/ft.cc
Outdated
| static void unpin_by_backup_callback(FT ft, void *extra) { | ||
| invariant(extra == NULL); | ||
| invariant(ft->num_backups>0); | ||
| ft->num_backups --; |
Contributor
There was a problem hiding this comment.
No space before the operator
ft/ft.cc
Outdated
| } | ||
|
|
||
| // maps to cf->note_unpin_by_backup | ||
| //Must be protected by ydb lock. |
ft/tests/ft-in-backup-test.cc
Outdated
| This file is part of PerconaFT. | ||
|
|
||
|
|
||
| Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. |
ft/tests/ft-in-backup-test.cc
Outdated
| along with PerconaFT. If not, see <http://www.gnu.org/licenses/>. | ||
| ======= */ | ||
|
|
||
| #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." |
Author
There was a problem hiding this comment.
omg...how did you spot it...hawkeyes
ft/tests/ft-in-backup-test.cc
Outdated
|
|
||
| toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr); | ||
| // TEST1 : for normal | ||
| r = toku_open_ft_handle(fname, 1, &ft, 1<<12, 1<<9, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, toku_builtin_compare_fun); |
Contributor
There was a problem hiding this comment.
This and similar lines below are probably too long. A new file can be clang-formatted without much damage I guess
Author
|
Thanks. Please review my follow-up |
laurynas-biveinis
suggested changes
Sep 18, 2017
ft/ft.cc
Outdated
| FT ft = (FT) header_v; | ||
| toku_ft_grab_reflock(ft); | ||
| assert(toku_ft_needed_unlocked(ft)); | ||
| ft->num_backups ++; |
Contributor
There was a problem hiding this comment.
No space before the postincrement operator
ft/ft.cc
Outdated
| ft_note_pin_by_checkpoint, | ||
| ft_note_unpin_by_checkpoint); | ||
| ft_note_unpin_by_checkpoint, | ||
| ft_note_pin_by_backup, |
Contributor
There was a problem hiding this comment.
Indentation must be wrong either in the added lines, either in the lines above (in which I'm not sure it should be fixed)
| ft_note_pin_by_checkpoint, | ||
| ft_note_unpin_by_checkpoint); | ||
| ft_note_unpin_by_checkpoint, | ||
| ft_note_pin_by_backup, |
| &dummy_note_pin, | ||
| &dummy_note_unpin | ||
| &dummy_note_unpin, | ||
| &dummy_note_pin, |
| &dummy_note_pin, | ||
| &dummy_note_unpin | ||
| &dummy_note_unpin, | ||
| &dummy_note_pin, |
ft/tests/cachetable-simple-close.cc
Outdated
| &dummy_note_pin, | ||
| &dummy_note_unpin | ||
| &dummy_note_unpin, | ||
| &dummy_note_pin, |
ft/tests/cachetable-test.h
Outdated
| &dummy_end, | ||
| &dummy_note_pin, | ||
| &dummy_note_unpin, | ||
| &dummy_note_pin, |
…der.
This is an attempt based on @bohutang's patch
percona#331
in particular, the ctest is all his credits.
Summary:
1) The issue is real.
2) @bohu's patch works for mediating the issue but somewhat introduces
a ft leak that the ft with ref=0 may be left until next open/close or
checkpoint.
3) If ft_close should be held off upon a backup, then it simply means
a backup should hold a ref to the ft and responsible for closing ft up
if it is the last one to hold it, like any other possible referencer.
including the checkpoint, the txn and ft handlers.
4) mtr test contributed by @bohutang still passes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updated: fixed the format again.
new jenkins test: http://jenkins.percona.com/view/TokuDB/job/PerconaFT-param/107/
Updated: fixed the format.
new Jenkins test: http://jenkins.percona.com/view/TokuDB/job/PerconaFT-param/106
Jenkins: http://jenkins.percona.com/view/TokuDB/job/PerconaFT-param/105/