Skip to content
This repository has been archived by the owner on Jul 30, 2021. It is now read-only.

Support for Mongo driver >= 2.0 #15

Open
karthikmuralidharan opened this issue Nov 28, 2015 · 4 comments
Open

Support for Mongo driver >= 2.0 #15

karthikmuralidharan opened this issue Nov 28, 2015 · 4 comments

Comments

@karthikmuralidharan
Copy link

Please correct me if I am wrong, but does the current gem support Mongo ruby driver v2 and above ? I had to downgrade it to 1.9.2 for it to work.

@poislagarde
Copy link

I know this is an old issue, but I was wondering how much work would be needed to update to mongo driver >= 2.0 ? I know there's some breaking changes, and even though I'm not very familiar with Ruby I can try to help.

Any thoughts @den-stripe ?

@den-stripe
Copy link
Contributor

Hey @poislagarde !
I have not tried to run it with mongo driver >= 2.0. So not sure what is required to make it work.

@thucnc
Copy link

thucnc commented Jan 1, 2018

Mosql/Mongoriver doesn't work well with mongodb 3.6. It often gets below exception at line 170 of tailer.rb file (@cursor.next)

PlanExecutor killed: CappedPositionLost: CollectionScan died due to position in capped collection being deleted. Last seen record id:

So, may you advise how to upgrade mongoriver compatible with new mongodb driver ?
P.S: When I rerun the mosql script after its failure, it works again without any data lost, so I tried to add a rescue block as below but it doesn't work:

     begin
        while !@stop && !state.break? && @cursor.has_next?
          state.increment
          record = @cursor.next
          case database_type
          when :mongo
            blk.call(record, state)
          when :toku
            converted = Toku.convert(record, @upstream_conn)
            converted.each do |converted_record|
              blk.call(converted_record, state)
            end
          end
        end
      rescue
        puts "exception cursor.next"
        state.increment
      end

johnnason pushed a commit to johnnason/mongoriver that referenced this issue Jan 5, 2018
@johnnason
Copy link

I'm using ->mosql->mongoriver for mongo to pg oplog streaming, and the above PR is working for me. Still doing more testing, but have streamed many many thousands of records accurately so far. Where I'd be more worried about the above PR is some connection scenarios I have may not have tried, and TokuMX.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants