Skip to content

Conversation

Jun-Yuan
Copy link

@Jun-Yuan Jun-Yuan commented Sep 4, 2017

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/

    This is an attempt based on @BohuTang's patch
    https://github.com/percona/PerconaFT/pull/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

Copy link
Contributor

@laurynas-biveinis laurynas-biveinis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting comments only

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please no commented-out code?

ft/ft.cc Outdated


// maps to cf->note_pin_by_backup
//Must be protected by ydb lock.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spaces after //

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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spaces around >

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 --;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No space before the operator

ft/ft.cc Outdated
}

// maps to cf->note_unpin_by_backup
//Must be protected by ydb lock.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spaces after //

This file is part of PerconaFT.
Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still missed s/2015/2017

along with PerconaFT. If not, see <http://www.gnu.org/licenses/>.
======= */

#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2017

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

omg...how did you spot it...hawkeyes


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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and similar lines below are probably too long. A new file can be clang-formatted without much damage I guess

@Jun-Yuan
Copy link
Author

Thanks. Please review my follow-up

ft/ft.cc Outdated
FT ft = (FT) header_v;
toku_ft_grab_reflock(ft);
assert(toku_ft_needed_unlocked(ft));
ft->num_backups ++;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likewise

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated again. Thanks!

&dummy_note_pin,
&dummy_note_unpin
&dummy_note_unpin,
&dummy_note_pin,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likewise

&dummy_note_pin,
&dummy_note_unpin
&dummy_note_unpin,
&dummy_note_pin,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likewise

&dummy_note_pin,
&dummy_note_unpin
&dummy_note_unpin,
&dummy_note_pin,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likewise

&dummy_end,
&dummy_note_pin,
&dummy_note_unpin,
&dummy_note_pin,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likewise

…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants