Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with redis-oplog + monti #125

Closed
skeetmtp opened this issue Jun 20, 2024 · 2 comments
Closed

Issue with redis-oplog + monti #125

skeetmtp opened this issue Jun 20, 2024 · 2 comments

Comments

@skeetmtp
Copy link
Contributor

skeetmtp commented Jun 20, 2024

We got reactivity issues when using monti apm version 2.49.2 + latest redis-oplog (curlofcode)

It seems related to "limit" option we use in our publish, when i remove the limit option there is no more issue.

I think I succeed to reduce to a simple test case by tweeking one of existing unit test : in fact, just adding {limit: 100}
I see no reason for this test to pass without limit, but fail with large limit

addTestWithRoundedTime.only('Database - Redis Oplog - Removed', function (test) {
  // limit publish
  const pub = RegisterPublication(() => TestData.find({}, {limit: 100}));

  TestData.remove({});

  const client = GetMeteorClient();
  const sub = SubscribeAndWait(client, pub);

  TestData.insert({ name: 'test1' });
  TestData.insert({ name: 'test2' });
  TestData.insert({ name: 'test3' });

  Meteor._sleepForMs(100);

  TestData.remove({ name: 'test2' });

  Meteor._sleepForMs(100);

  let metrics = FindMetricsForPub(pub);

  test.equal(metrics.totalObservers, 1);
  test.equal(metrics.liveRemovedDocuments, 1);

  TestData.remove({});

  Meteor._sleepForMs(100);

  metrics = FindMetricsForPub(pub);

  test.equal(metrics.totalObservers, 1);
  test.equal(metrics.liveRemovedDocuments, 3);

  sub.stop();
  TestData.remove({});

  Meteor._sleepForMs(100);
});

mtest --package ./ --once --release 2.14

[[[[[ Tests ]]]]]

=> Started proxy.
=> Started MongoDB.
=> Linted your app. No linting errors.
I20240620-18:14:04.025(2)? test-in-console listening
=> Started your app.

=> App running at: http://localhost:10780/
Running tests...
S: tinytest - Database - Redis Oplog - Removed : !!!!!!!!! FAIL !!!!!!!!!!!
{"groupPath":["tinytest","Database","Redis Oplog"],"test":"Removed","events":[{"sequence":1,"type":"fail","details":{"type":"assert_equal","expected":"1","actual":"0","not":false}}],"server":true}
@skeetmtp
Copy link
Contributor Author

skeetmtp commented Jun 20, 2024

May be @renanccastro you have a clue ? As I saw a commit from you 3f2ad57 about fixing issue with limit/sort

@zodern
Copy link
Member

zodern commented Jun 20, 2024

Thanks @skeetmtp. The reproduction was very helpful. It's fixed in v2.49.3.

Redis oplog handles queries with a limit differently than other queries. The issue was with how the agent instrumented a class used for queries with limits.

@zodern zodern closed this as completed Jun 20, 2024
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

No branches or pull requests

2 participants