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

inconsistent result when sorted predicate does not contain value on some nodes #2672

Open
u007 opened this Issue Oct 18, 2018 · 9 comments

Comments

Projects
None yet
5 participants
@u007
Copy link

u007 commented Oct 18, 2018

If you suspect this could be a bug, follow the template.

  • What version of Dgraph are you using?
    1.0.9

  • Have you tried reproducing the issue with latest release?
    version above

  • What is the hardware spec (RAM, OS)?
    8gb ram, macosx 10.13.6

  • Steps to reproduce the issue (command/config used to run Dgraph).

index a predicate, for example: created_at @ time
insert several nodes without a created_at set,
then insert another several nodes with created_at

then query with orderasc/desc created_at and with first: 10

  • Expected behaviour and actual result.

result should show only nodes with created_at

actual results, 50% of times it return rows with created_at,
another 50% of times return rows without created_at

as stated in few last post here:

https://discuss.dgraph.io/t/orderasc-desc-by-object-that-is-missing-the-field-data/3389/9

@u007

This comment has been minimized.

Copy link

u007 commented Oct 18, 2018

ive feeling that it may also happen if ive inserted records without created_at predicate,
then only index created_at, and then insert those records with created_at.
if the original issue post above did not work, try this reproduction

@calummoore

This comment has been minimized.

Copy link

calummoore commented Oct 19, 2018

I have experienced this also, but now I can't get it to reproduce (as some more data was added in between). Next time I see it I will export the affected data, so we can try to reproduce.

2018-10-18 09-12-34 2018-10-18 09_13_36

@srfrog srfrog added the investigate label Oct 19, 2018

@u007

This comment has been minimized.

Copy link

u007 commented Oct 22, 2018

and the weird part is that i could not delete the uid only object.
those data with created_at and other fields, i could delete it entirely

@MichelDiz

This comment has been minimized.

Copy link
Contributor

MichelDiz commented Nov 15, 2018

and the weird part is that i could not delete the uid only object.

I think I've mentioned before, empty nodes will continue to exist. And they are considered Orphans / Deleted. Ignore them.

those data with created_at and other fields, i could delete it entirely

Using the deletion procedure in the documentation still does this happen?
https://docs.dgraph.io/mutations/#delete

@u007 Please can you try with a later version. Just to check. I tried reproduce with the template I did there in the Discuss, but I did not get that effect.

I need something that is obvious, or that put me on the right path to reproduce. Otherwise it is a waste of time, no one will analyze the case in the short term.

Cheers.

@calummoore

This comment has been minimized.

Copy link

calummoore commented Nov 15, 2018

I haven't been able to reproduce this, will let you know if it appears again.

@u007

This comment has been minimized.

Copy link

u007 commented Nov 15, 2018

do you suggest that i need to add in filter like has(_predicate_) ?

the problem was that those are ghost or deleted object. it contains no predicates and only uid

@MichelDiz

This comment has been minimized.

Copy link
Contributor

MichelDiz commented Nov 15, 2018

Filtering is good, but use literal predicates. Do not use _predicate_.

I'm not sure if you're just expressing yourself. The correct way to express a literal predicate would be has(<predicate>) .

btw, About this statement:

actual results, 50% of times it return rows with created_at,
another 50% of times return rows without created_at

Can you show the used Query? In practice Dgraph does not return Nodes that do not have "created_at" (before) or if you query for "created_at" with sort or filter by it. If the case is "Phantom Nodes", the use of the filter is recommended for now.

This issue here #2484 is related - As you can see, the predicate still there hided in the Phantom Node. So that's why need to filter.

and #2212
and #2574

Any updates let me know. I'll mark this issue to close in a week if there are no changes. Or if see srfrog/gus work on it and fix it.

Thanks all for your report and feedback!

@manishrjain manishrjain added bug and removed investigate labels Jan 11, 2019

@manishrjain

This comment has been minimized.

Copy link
Member

manishrjain commented Jan 11, 2019

Just reading from the top post, seems like a bug.

@srfrog srfrog self-assigned this Jan 14, 2019

@srfrog

This comment has been minimized.

Copy link
Contributor

srfrog commented Jan 14, 2019

hi @u007 and @calummoore I tested this bug against the current master and it seems to be working correctly. Could you confirm? If you can reproduce please give me the steps to get there. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment