Skip to content
This repository was archived by the owner on Dec 22, 2021. It is now read-only.

Conversation

@TBSliver
Copy link
Contributor

No description provided.

TBSliver and others added 21 commits May 10, 2018 17:02
Rather than pass in a MongoDB::_Link object to helpers like document
pre-encoders and the bypass document validation role, this passes in
only a boolean value.

This allows us to get the link object out of the bulk write execution
loop, which is needed for retryable writes.
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.5%) to 79.486% when pulling 6f51dfd on shadow-dot-cat:TBSliver/PERL-792 into ed9378e on mongodb:master.

# event, just that the failed one comes first.
my $first_insert_index;

for my $f_idx ( 0 .. $#events ) {
Copy link
Contributor

Choose a reason for hiding this comment

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

$#events -1? Or line 199 could go off the end. Should never happen if command monitoring is working right and always pairing, but I'd rather not rely on a reader knowing that.


my $second_insert_index;

for my $s_idx ( $first_insert_index + 2 .. $#events ) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto, plus it's worth checking there are enough events past the first.

} @{ $self->queue };
}

## Encapsulate the write loop for this
Copy link
Contributor

Choose a reason for hiding this comment

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

Please figure out what of this comment needs to be kept (if any) for documentation purposes and what can be deleted.

unshift @left_to_send, $self->_split_chunk( $chunk, $_->size );
}
}
# Put retryable writes catches... no not here... damn... ermm... oh. Could increment transaction id at the beginning before the loop, then after the redo increment again. Then it wont get caught? hmm.... food
Copy link
Contributor

Choose a reason for hiding this comment

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

?!?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah oops I thought i got rid of that comment... Was from the odd debugging stuff when I tied the driver in knots with $link


use strict;
use warnings;
package MongoDB::Role::_RetryableBulk;
Copy link
Contributor

Choose a reason for hiding this comment

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

Having a role just to provide an attribute seems excessive. I think it's OK to just put it in the two classes that need it.

@@ -0,0 +1,320 @@
#
Copy link
Contributor

Choose a reason for hiding this comment

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

I like how this file turned out! Very easy to follow.

@xdg
Copy link
Contributor

xdg commented May 18, 2018

This is just about done. Just a few more things to do.

Also, rather than leave the tests as t/PERL-..., please call them t/retryable-... with some sensible description.

@TBSliver
Copy link
Contributor Author

there we go! Hope that all works :D

@xdg
Copy link
Contributor

xdg commented May 21, 2018

LGTM. I'll try to rebase and get it merged.

@xdg
Copy link
Contributor

xdg commented May 21, 2018

Rebased, fixed up, and merged. Thanks!

@xdg xdg closed this May 21, 2018
@TBSliver TBSliver deleted the TBSliver/PERL-792 branch September 14, 2018 14:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants