[SERVER-54720] Make --system-wiredtiger work again Created: 23/Feb/21  Updated: 05/Dec/22

Status: Open
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Sulabh Mahajan Assignee: Backlog - Storage Engines Team
Resolution: Unresolved Votes: 0
Labels: dev-prod
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File system-wiredtiger-master.diff    
Assigned Teams:
Storage Engines
Operating System: ALL
Sprint: StorEng - Refinement Pipeline
Participants:
Story Points: 8

 Description   

WiredTiger team used --system-wiredtiger flag a lot to externally build and link MongoDB, instead of recompiling MongoDB with changes to WiredTiger. The flag stopped working some time back.

I am creating this ticket to help us with:

  • get the flag working again OR
  • remove the flag altogether
  • get a wiki / document explaining the steps in how to get external WiredTiger working with MongoDB, if possible.


 Comments   
Comment by Sulabh Mahajan [ 26/Jul/21 ]

acm,

Thanks for responding. I will create a change for the attached diff as a part of the separate ticket and cc you.

Sorry, I am being kept busy with several other things, so I am slow at getting back to this ticket.

Comment by Andrew Morrow (Inactive) [ 19/Jul/21 ]

sulabh.mahajan -

I think there are definitely things that can be done to improve the situation.

  • First, let's get that patch merged, as it looks pretty uncontroversial to me.
  • Next, I think there is probably a way to get rid of the need for LD_LIBRARY_PATH being set in the environment by building the server sources with an augmented DT_RUNPATH so that the installation directory for wiredteger is always searched. If wiredtiger installs a pkgconfig file that includes the runpath requirements, that would be even better, as we could probably write a SCons variables file for the server build that could set CPPPATH and LIBPATH and LIBFLAGS for rpath appropriately.
  • Finally, I think it would be pretty reasonable to stand up a compile only evergreen waterfall builder that built the server sources against system wiredtiger to ensure that support does not regress.

The tricky part here though is the checksum library. The procedure above appears to me to be made significantly more complex due to the fact that the checksum library can only be produced by the server build. If the wiredtiger build system could be updated to build a separated wiredtiger and wiredtiger_checksum library, then that complexity would be eliminated.

Alternatively, we could find a way to eliminate the need to build a separated wiredtiger_checksum library in the mongo build. To be quite honest I don't entirely remember what forces converged to require it. Perhaps we can or should revisit that decision?

Comment by Sulabh Mahajan [ 19/Jul/21 ]

acm,

The current process - as we follow in the wiki - is:

  • Build WiredTiger
  • Patch MongoDB with the attached diff
  • Build MongoDB normally to get "src/third_party/wiredtiger/libwiredtiger_checksum.a"
  • Rebuild MongoDB with "--use-system-wiredtiger" option
  • Execute MongoDB with LD_LIBRARY_PATH to WiredTiger

Assuming someone has installed wired tiger to a path they by default include in LD_LIBRARY_PATH, ideally, the process should look like this:

  • Build and install WiredTiger to the path
  • Build MongoDB with "--use-system-wiredtiger" option
  • Execute MongoDB with LD_LIBRARY_PATH to WiredTiger

To get there I suppose we will need to get the attached diff checked-in and figure out a way to let MongoDB share libwiredtiger_checksum with system wired tiger. I only vaguely recall that at some point MongoDB got exposed to using libwiredtiger_checksum directly, and we ended up having to build it separately through MongoDB-scons.

mjc@wiredtiger.com, you have been using this option far longer than anyone else I know. Do you want to add anything here, or have ideas on improvements?

Comment by Andrew Morrow (Inactive) [ 14/Jul/21 ]

sulabh.mahajan - Sure we can take a look. Can you provide a summary of what you would like to see improved or changed?

Comment by Sulabh Mahajan [ 14/Jul/21 ]

acm, can someone from your team help with getting --system-wiredtiger work smoothly again.

Generated at Thu Feb 08 05:34:18 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.