[PATCH] Fix: Failed to remove backlink of memberOf when deleting dsdb_module_search_dn: did not find base dn

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] Fix: Failed to remove backlink of memberOf when deleting dsdb_module_search_dn: did not find base dn

Samba - samba-technical mailing list
Hello list,

I had some replication issues with Samba 4.7.0 as RODC:
https://lists.samba.org/archive/samba/2017-October/211536.html

Failed to apply records: ../source4/dsdb/samdb/ldb_modules/repl_meta_data.c:4218: Failed to remove backlink of memberOf when deleting CN=USER\0ADEL:a1f2a2cc-1179-4734-b753-c121ed02a34c,CN=Deleted Objects,DC=samdom,DC=intern: dsdb_module_search_dn: did not find base dn CN=GROUP\0ADEL:030d0be1-3ada-4b93-8371-927f20923116,CN=Deleted Objects,DC=samdom,DC=intern (0 results): Operations error
Failed to commit objects: WERR_GEN_FAILURE/NT_STATUS_INVALID_NETWORK_RESPONSE

I maybe found the solution for this issue, the search request do not find base dn because DSDB_SEARCH_SHOW_DELETED flag was not set.

Please review.

Thanks
----------------------------------------------------------------------------------------------------------
Andrej Gessel ([hidden email]<mailto:[hidden email]>)



0001-repl_meta_data-Fix-removing-of-backlink-on-deleted-o.patch (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Fix: Failed to remove backlink of memberOf when deleting dsdb_module_search_dn: did not find base dn

Samba - samba-technical mailing list
On Thu, 2017-10-19 at 15:35 +0000, Andrej Gessel via samba-technical
wrote:
> Hello list,
>
> I had some replication issues with Samba 4.7.0 as RODC:
> https://lists.samba.org/archive/samba/2017-October/211536.html
>
> Failed to apply records: ../source4/dsdb/samdb/ldb_modules/repl_meta_data.c:4218: Failed to remove backlink of memberOf when deleting CN=USER\0ADEL:a1f2a2cc-1179-4734-b753-c121ed02a34c,CN=Deleted Objects,DC=samdom,DC=intern: dsdb_module_search_dn: did not find base dn CN=GROUP\0ADEL:030d0be1-3ada-4b93-8371-927f20923116,CN=Deleted Objects,DC=samdom,DC=intern (0 results): Operations error
> Failed to commit objects: WERR_GEN_FAILURE/NT_STATUS_INVALID_NETWORK_RESPONSE
>
> I maybe found the solution for this issue, the search request do not find base dn because DSDB_SEARCH_SHOW_DELETED flag was not set.

Very, very interesting.  I think it is correct, the only thing we will
need is a test.

The test will actually be a bit tricky to create, as current Samba will
strip the links when the object is first deleted, so there can't be
links to a deleted object, but older Samba versions were not so well
behaved.  To test it, I'll have to do some of those evil backend
modifications in the that I keep telling folks not to do ;-)

I'll probably extend
testprogs/blackbox/tombstones-expunge.sh but you are most welcome to
have a go if you like!

Thank you very much!

Andrew Bartlett
--
Andrew Bartlett                       http://samba.org/~abartlet/
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba


Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Fix: Failed to remove backlink of memberOf when deleting dsdb_module_search_dn: did not find base dn

Samba - samba-technical mailing list
In reply to this post by Samba - samba-technical mailing list
On Thu, 2017-10-19 at 15:35 +0000, Andrej Gessel via samba-technical
wrote:

> Hello list,
>
> I had some replication issues with Samba 4.7.0 as RODC:
> https://lists.samba.org/archive/samba/2017-October/211536.html
>
> Failed to apply records: ../source4/dsdb/samdb/ldb_modules/repl_meta_data.c:4218: Failed to remove backlink of memberOf when deleting CN=USER\0ADEL:a1f2a2cc-1179-4734-b753-c121ed02a34c,CN=Deleted Objects,DC=samdom,DC=intern: dsdb_module_search_dn: did not find base dn CN=GROUP\0ADEL:030d0be1-3ada-4b93-8371-927f20923116,CN=Deleted Objects,DC=samdom,DC=intern (0 results): Operations error
> Failed to commit objects: WERR_GEN_FAILURE/NT_STATUS_INVALID_NETWORK_RESPONSE
>
> I maybe found the solution for this issue, the search request do not find base dn because DSDB_SEARCH_SHOW_DELETED flag was not set.
>
> Please review.
>
> Thanks
> ----------------------------------------------------------------------------------------------------------
> Andrej Gessel ([hidden email]<mailto:[hidden email]>)

Thanks for your patience with this.  I've written the test, but can you
just please reply that you are happy for me to add your Signed-off-by
to the patch, or better still send it back with that on it?

If you have not yet, please also follow the contributing steps on the
wiki.

Finally, if you would like this in Samba 4.7, please open a bug.

Thanks!

Andrew Bartlett

--
Andrew Bartlett
https://samba.org/~abartlet/
Authentication Developer, Samba Team         https://samba.org
Samba Development and Support, Catalyst IT  
https://catalyst.net.nz/services/samba





Reply | Threaded
Open this post in threaded view
|

AW: [PATCH] Fix: Failed to remove backlink of memberOf when deleting dsdb_module_search_dn: did not find base dn

Samba - samba-technical mailing list
Hi Andrew,

thanks for writing a test. I have to talk to my company first, to be legally safe. I will resend patch, when I get the answer.


Andrej

-----Ursprüngliche Nachricht-----
Von: Andrew Bartlett [mailto:[hidden email]]
Gesendet: Dienstag, 31. Oktober 2017 02:32
An: Andrej Gessel <[hidden email]>; [hidden email]
Betreff: Re: [PATCH] Fix: Failed to remove backlink of memberOf when deleting dsdb_module_search_dn: did not find base dn

On Thu, 2017-10-19 at 15:35 +0000, Andrej Gessel via samba-technical
wrote:

> Hello list,
>
> I had some replication issues with Samba 4.7.0 as RODC:
> https://lists.samba.org/archive/samba/2017-October/211536.html
>
> Failed to apply records:
> ../source4/dsdb/samdb/ldb_modules/repl_meta_data.c:4218: Failed to
> remove backlink of memberOf when deleting
> CN=USER\0ADEL:a1f2a2cc-1179-4734-b753-c121ed02a34c,CN=Deleted
> Objects,DC=samdom,DC=intern: dsdb_module_search_dn: did not find base
> dn CN=GROUP\0ADEL:030d0be1-3ada-4b93-8371-927f20923116,CN=Deleted
> Objects,DC=samdom,DC=intern (0 results): Operations error Failed to
> commit objects: WERR_GEN_FAILURE/NT_STATUS_INVALID_NETWORK_RESPONSE
>
> I maybe found the solution for this issue, the search request do not find base dn because DSDB_SEARCH_SHOW_DELETED flag was not set.
>
> Please review.
>
> Thanks
> ----------------------------------------------------------------------
> ------------------------------------
> Andrej Gessel
> ([hidden email]<mailto:[hidden email]>)

Thanks for your patience with this.  I've written the test, but can you just please reply that you are happy for me to add your Signed-off-by to the patch, or better still send it back with that on it?

If you have not yet, please also follow the contributing steps on the wiki.

Finally, if you would like this in Samba 4.7, please open a bug.

Thanks!

Andrew Bartlett

--
Andrew Bartlett
https://samba.org/~abartlet/
Authentication Developer, Samba Team         https://samba.org
Samba Development and Support, Catalyst IT  
https://catalyst.net.nz/services/samba




Reply | Threaded
Open this post in threaded view
|

AW: [PATCH] Fix: Failed to remove backlink of memberOf when deleting dsdb_module_search_dn: did not find base dn

Samba - samba-technical mailing list
Hello Andrew,



I rebased my patch, corrected spelling error and add Sign-Off-By line.



Additionally I have sent this bug to [hidden email], because I do not have an Samba bugzilla account.



Thanks



Andrej



________________________________
Von: samba-technical <[hidden email]> im Auftrag von Andrej Gessel via samba-technical <[hidden email]>
Gesendet: Mittwoch, 1. November 2017 10:56
An: Andrew Bartlett; [hidden email]
Betreff: AW: [PATCH] Fix: Failed to remove backlink of memberOf when deleting dsdb_module_search_dn: did not find base dn

Hi Andrew,

thanks for writing a test. I have to talk to my company first, to be legally safe. I will resend patch, when I get the answer.


Andrej

-----Ursprüngliche Nachricht-----
Von: Andrew Bartlett [mailto:[hidden email]]
Gesendet: Dienstag, 31. Oktober 2017 02:32
An: Andrej Gessel <[hidden email]>; [hidden email]
Betreff: Re: [PATCH] Fix: Failed to remove backlink of memberOf when deleting dsdb_module_search_dn: did not find base dn

On Thu, 2017-10-19 at 15:35 +0000, Andrej Gessel via samba-technical
wrote:

> Hello list,
>
> I had some replication issues with Samba 4.7.0 as RODC:
> https://lists.samba.org/archive/samba/2017-October/211536.html
>
> Failed to apply records:
> ../source4/dsdb/samdb/ldb_modules/repl_meta_data.c:4218: Failed to
> remove backlink of memberOf when deleting
> CN=USER\0ADEL:a1f2a2cc-1179-4734-b753-c121ed02a34c,CN=Deleted
> Objects,DC=samdom,DC=intern: dsdb_module_search_dn: did not find base
> dn CN=GROUP\0ADEL:030d0be1-3ada-4b93-8371-927f20923116,CN=Deleted
> Objects,DC=samdom,DC=intern (0 results): Operations error Failed to
> commit objects: WERR_GEN_FAILURE/NT_STATUS_INVALID_NETWORK_RESPONSE
>
> I maybe found the solution for this issue, the search request do not find base dn because DSDB_SEARCH_SHOW_DELETED flag was not set.
>
> Please review.
>
> Thanks
> ----------------------------------------------------------------------
> ------------------------------------
> Andrej Gessel
> ([hidden email]<mailto:[hidden email]>)
Thanks for your patience with this.  I've written the test, but can you just please reply that you are happy for me to add your Signed-off-by to the patch, or better still send it back with that on it?

If you have not yet, please also follow the contributing steps on the wiki.

Finally, if you would like this in Samba 4.7, please open a bug.

Thanks!

Andrew Bartlett

--
Andrew Bartlett
https://samba.org/~abartlet/
Authentication Developer, Samba Team         https://samba.org
Samba Development and Support, Catalyst IT
https://catalyst.net.nz/services/samba




0001-repl_meta_data-Fix-removing-of-backlink-on-deleted-o.patch (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

AW: [PATCH] Fix: Failed to remove backlink of memberOf when deleting dsdb_module_search_dn: did not find base dn

Samba - samba-technical mailing list
Hello Andrew,

I have filed a BUG to backport the changes to earlier versions.

https://bugzilla.samba.org/show_bug.cgi?id=13120


Thank you!

Andrej

-----Ursprüngliche Nachricht-----
Von: samba-technical [mailto:[hidden email]] Im Auftrag von Andrej Gessel via samba-technical
Gesendet: Donnerstag, 2. November 2017 12:11
An: Andrew Bartlett <[hidden email]>; [hidden email]
Betreff: AW: [PATCH] Fix: Failed to remove backlink of memberOf when deleting dsdb_module_search_dn: did not find base dn

Hello Andrew,



I rebased my patch, corrected spelling error and add Sign-Off-By line.



Additionally I have sent this bug to [hidden email], because I do not have an Samba bugzilla account.



Thanks



Andrej



________________________________
Von: samba-technical <[hidden email]> im Auftrag von Andrej Gessel via samba-technical <[hidden email]>
Gesendet: Mittwoch, 1. November 2017 10:56
An: Andrew Bartlett; [hidden email]
Betreff: AW: [PATCH] Fix: Failed to remove backlink of memberOf when deleting dsdb_module_search_dn: did not find base dn

Hi Andrew,

thanks for writing a test. I have to talk to my company first, to be legally safe. I will resend patch, when I get the answer.


Andrej

-----Ursprüngliche Nachricht-----
Von: Andrew Bartlett [mailto:[hidden email]]
Gesendet: Dienstag, 31. Oktober 2017 02:32
An: Andrej Gessel <[hidden email]>; [hidden email]
Betreff: Re: [PATCH] Fix: Failed to remove backlink of memberOf when deleting dsdb_module_search_dn: did not find base dn

On Thu, 2017-10-19 at 15:35 +0000, Andrej Gessel via samba-technical
wrote:

> Hello list,
>
> I had some replication issues with Samba 4.7.0 as RODC:
> https://lists.samba.org/archive/samba/2017-October/211536.html
>
> Failed to apply records:
> ../source4/dsdb/samdb/ldb_modules/repl_meta_data.c:4218: Failed to
> remove backlink of memberOf when deleting
> CN=USER\0ADEL:a1f2a2cc-1179-4734-b753-c121ed02a34c,CN=Deleted
> Objects,DC=samdom,DC=intern: dsdb_module_search_dn: did not find base
> dn CN=GROUP\0ADEL:030d0be1-3ada-4b93-8371-927f20923116,CN=Deleted
> Objects,DC=samdom,DC=intern (0 results): Operations error Failed to
> commit objects: WERR_GEN_FAILURE/NT_STATUS_INVALID_NETWORK_RESPONSE
>
> I maybe found the solution for this issue, the search request do not find base dn because DSDB_SEARCH_SHOW_DELETED flag was not set.
>
> Please review.
>
> Thanks
> ----------------------------------------------------------------------
> ------------------------------------
> Andrej Gessel
> ([hidden email]<mailto:[hidden email]>)

Thanks for your patience with this.  I've written the test, but can you just please reply that you are happy for me to add your Signed-off-by to the patch, or better still send it back with that on it?

If you have not yet, please also follow the contributing steps on the wiki.

Finally, if you would like this in Samba 4.7, please open a bug.

Thanks!

Andrew Bartlett

--
Andrew Bartlett
https://samba.org/~abartlet/
Authentication Developer, Samba Team         https://samba.org
Samba Development and Support, Catalyst IT https://catalyst.net.nz/services/samba



Reply | Threaded
Open this post in threaded view
|

Re: AW: [PATCH] Fix: Failed to remove backlink of memberOf when deleting dsdb_module_search_dn: did not find base dn

Samba - samba-technical mailing list
In reply to this post by Samba - samba-technical mailing list
On Thu, 2017-11-02 at 11:10 +0000, Andrej Gessel wrote:
> Hello Andrew,
>  
> I rebased my patch, corrected spelling error and add Sign-Off-By line. 
>  
> Additionally I have sent this bug to [hidden email], because I do not have an Samba bugzilla account.
>  
> Thanks
>  
> Andrej

Thanks.  Metze and I are working on getting this into master shortly,
and then a backport will follow.

Sorry this has taken so long.

Andrew Bartlett

--
Andrew Bartlett
https://samba.org/~abartlet/
Authentication Developer, Samba Team         https://samba.org
Samba Development and Support, Catalyst IT  
https://catalyst.net.nz/services/samba





Reply | Threaded
Open this post in threaded view
|

Re: AW: [PATCH] Fix: Failed to remove backlink of memberOf when deleting dsdb_module_search_dn: did not find base dn

Samba - samba-technical mailing list
On Fri, 2017-11-24 at 11:11 +1300, Andrew Bartlett wrote:

> On Thu, 2017-11-02 at 11:10 +0000, Andrej Gessel wrote:
> > Hello Andrew,
> >  
> > I rebased my patch, corrected spelling error and add Sign-Off-By line. 
> >  
> > Additionally I have sent this bug to [hidden email], because I do not have an Samba bugzilla account.
> >  
> > Thanks
> >  
> > Andrej
>
> Thanks.  Metze and I are working on getting this into master shortly,
> and then a backport will follow.
>
> Sorry this has taken so long.
>
> Andrew Bartlett

BTW, when it lands it will have this change in it:

diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
index 28758ab..597e49c 100644 (file)
--- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
+++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
@@ -3793,7 +3793,7 @@ static int replmd_delete_remove_link(struct ldb_module *module,
                                            msg->dn, attrs,
                                            DSDB_FLAG_NEXT_MODULE |
                                            DSDB_SEARCH_SHOW_EXTENDED_DN |
-                                           DSDB_SEARCH_SHOW_DELETED,
+                                           DSDB_SEARCH_SHOW_RECYCLED,
                                            parent);

This is just making us work with a possible future where we might have
recycled objects.  

https://git.samba.org/?p=metze/samba/wip.git;a=commitdiff;h=c226a591762
596be6276a4b975fa501f49b36fb3
--
Andrew Bartlett
https://samba.org/~abartlet/
Authentication Developer, Samba Team         https://samba.org
Samba Development and Support, Catalyst IT  
https://catalyst.net.nz/services/samba





Reply | Threaded
Open this post in threaded view
|

AW: AW: [PATCH] Fix: Failed to remove backlink of memberOf when deleting dsdb_module_search_dn: did not find base dn

Samba - samba-technical mailing list
Hello Andrew,

I'm following your thread with metze and I'm happy, that it is going into master.

Thank you.

Andrej

-----Ursprüngliche Nachricht-----
Von: Andrew Bartlett [mailto:[hidden email]]
Gesendet: Donnerstag, 23. November 2017 23:20
An: Andrej Gessel <[hidden email]>; [hidden email]
Betreff: Re: AW: [PATCH] Fix: Failed to remove backlink of memberOf when deleting dsdb_module_search_dn: did not find base dn

On Fri, 2017-11-24 at 11:11 +1300, Andrew Bartlett wrote:

> On Thu, 2017-11-02 at 11:10 +0000, Andrej Gessel wrote:
> > Hello Andrew,
> >  
> > I rebased my patch, corrected spelling error and add Sign-Off-By
> > line.
> >  
> > Additionally I have sent this bug to [hidden email], because I do not have an Samba bugzilla account.
> >  
> > Thanks
> >  
> > Andrej
>
> Thanks.  Metze and I are working on getting this into master shortly,
> and then a backport will follow.
>
> Sorry this has taken so long.
>
> Andrew Bartlett

BTW, when it lands it will have this change in it:

diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
index 28758ab..597e49c 100644 (file)
--- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
+++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
@@ -3793,7 +3793,7 @@ static int replmd_delete_remove_link(struct ldb_module *module,
                                            msg->dn, attrs,
                                            DSDB_FLAG_NEXT_MODULE |
                                            DSDB_SEARCH_SHOW_EXTENDED_DN |
-                                           DSDB_SEARCH_SHOW_DELETED,
+                                           DSDB_SEARCH_SHOW_RECYCLED,
                                            parent);

This is just making us work with a possible future where we might have recycled objects.  

https://git.samba.org/?p=metze/samba/wip.git;a=commitdiff;h=c226a591762
596be6276a4b975fa501f49b36fb3
--
Andrew Bartlett
https://samba.org/~abartlet/
Authentication Developer, Samba Team         https://samba.org
Samba Development and Support, Catalyst IT  
https://catalyst.net.nz/services/samba