Mailing List Archive

Re: [mythtv-commits] Ticket #13261: Better solution for schema or protocol mismatch
On 04/30/2018 11:17 AM, MythTV wrote:
> #13261: Better solution for schema or protocol mismatch

> There are compile options -DIGNORE_SCHEMA_VER_MISMATCH
> -DIGNORE_PROTO_VER_MISMATCH that nullify the database check and upgrade
> process and the protocol version check process. These seem to be dangerous
> options, particularly since they have to be compiled into the system to
> use them.
>
> There may be cases where you want to ignore schema or protocol mismatch.
> The attached patch allows the use of override parameters -O
> !IgnoreSchemaVerMismatch=1 -O !IgnoreProtoVerMismatch=1 at run time. This
> way you do not have to build the system with those dangerous options, you
> can ignore the errors for a single run. Also the IgnoreSchemaVerMismatch
> only works for mythfrontend. Using it on mythbackend may be risky.

The whole reason these were made compile-time options rather than
settings is so that they wouldn't be put into packaged releases so that
users wouldn't expect the ability to run mismatched versions since we
only support running versions where the protocol and schema version
match. The idea of making them "hard to get to" was to ensure that they
were only used with great consideration--and the (user's) knowledge that
doing so may well break your entire MythTV data set (where packager's
knowledge of this fact is irrelevant to a user who loses everything due
to incompatibilty).

I still believe that if they're user-configurable settings (and
especially if they're relied on by packaged releases) that users will
come to believe that we support full forward and backward compatibility
of versions, so we might need to consider a way to achieve that goal if
this is really a desired solution.

Personally, my opinion is that we should be able to achieve full
database version independence by creating a dedicated data server and
never using direct SQL to access/write/retrieve data, but using some
other protocol to access the desired data (something like the MythTV
services or MythTV protocol or even something new) and coding the users
of the data to be resilient to differences in expected data and/or
handling errors in a user-friendly fashion--the latter of which we've
never done. More importantly, if an always-schema-version-correct data
server is the only component allowed to write data, it can handle data
differences safely--whether refusing to write data because it's too-far
different or because it's lacking critical values or choosing to write
the data and convert "old-format" data and choose appropriate defaults
for missing data. Until then, I think encouraging running different
MythTV components against mismatched schema version/schema-version
support is likely to only cause problems (which can definitely be
discouraging for users who lose data on a thousand recordings due to
corruption caused by some schema change they didn't think would be an
issue).

And, of course, protocol version independence is simply an issue of
coding every communications point to have resiliency/error checking
and/or coding support for every known (or supported) protocol version
(to achieve backwards compatibility). In fact, this is actually part of
the above database-schema-version-independence solution--if we simply
change all data access to be done through a data server to which we
communicate through some protocol version and code for data resiliency.

Mike
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: [mythtv-commits] Ticket #13261: Better solution for schema or protocol mismatch [ In reply to ]
Hi

> On 30 Apr 2018, at 6:28 pm, Michael T. Dean <mtdean@thirdcontact.com> wrote:
>
> And, of course, protocol version independence is simply an issue of coding every communications point to have resiliency/error checking and/or coding support for every known (or supported) protocol version (to achieve backwards compatibility). In fact, this is actually part of the above database-schema-version-independence solution--if we simply change all data access to be done through a data server to which we communicate through some protocol version and code for data resiliency.
>
> Mike

Fully agree with Mike..

those should *not* be made user configurable prefs.

_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: [mythtv-commits] Ticket #13261: Better solution for schema or protocol mismatch [ In reply to ]
On Mon, Apr 30, 2018 at 06:57:52PM +0200, Jean-Yves Avenard wrote:
> Hi
>
> > On 30 Apr 2018, at 6:28 pm, Michael T. Dean <mtdean@thirdcontact.com> wrote:
> >
> > And, of course, protocol version independence is simply an issue of coding every communications point to have resiliency/error checking and/or coding support for every known (or supported) protocol version (to achieve backwards compatibility). In fact, this is actually part of the above database-schema-version-independence solution--if we simply change all data access to be done through a data server to which we communicate through some protocol version and code for data resiliency.
> >
> > Mike
>
> Fully agree with Mike..
>
> those should *not* be made user configurable prefs.

<me-too/>

David
--
David Engel
david@istwok.net
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: [mythtv-commits] Ticket #13261: Better solution for schema or protocol mismatch [ In reply to ]
On Mon, 2018-04-30 at 12:28 -0400, Michael T. Dean wrote:
> On 04/30/2018 11:17 AM, MythTV wrote:
> > #13261: Better solution for schema or protocol mismatch
> > There are compile options -DIGNORE_SCHEMA_VER_MISMATCH
> > -DIGNORE_PROTO_VER_MISMATCH that nullify the database check and upgrade
> > process and the protocol version check process. These seem to be dangerous
> > options, particularly since they have to be compiled into the system to
> > use them.
> >
> > There may be cases where you want to ignore schema or protocol mismatch.
> > The attached patch allows the use of override parameters -O
> > !IgnoreSchemaVerMismatch=1 -O !IgnoreProtoVerMismatch=1 at run time. This
> > way you do not have to build the system with those dangerous options, you
> > can ignore the errors for a single run. Also the IgnoreSchemaVerMismatch
> > only works for mythfrontend. Using it on mythbackend may be risky.
>
> The whole reason these were made compile-time options rather than
> settings is so that they wouldn't be put into packaged releases so that
> users wouldn't expect the ability to run mismatched versions since we
> only support running versions where the protocol and schema version
> match. The idea of making them "hard to get to" was to ensure that they
> were only used with great consideration

Perhaps in that spirit we could/should require both the build to have
used the IGNORE_SCHEMA_VER_MISMATCH _and_ the runtime -O added here
(i.e. the compile time option just adds a new default-off runtime
option).

That would reduce the risk of having such compiled binaries floating
around since they would need to be manually "weaponsized" at runtime
too, thus addressing "do not have to build with those dangerous
options".

Ian.
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: [mythtv-commits] Ticket #13261: Better solution for schema or protocol mismatch [ In reply to ]
> On 1 May 2018, at 4:45 am, Ian Campbell <ijc@hellion.org.uk> wrote:
>
> Perhaps in that spirit we could/should require both the build to have
> used the IGNORE_SCHEMA_VER_MISMATCH _and_ the runtime -O added here
> (i.e. the compile time option just adds a new default-off runtime
> option).
>
> That would reduce the risk of having such compiled binaries floating
> around since they would need to be manually "weaponsized" at runtime
> too, thus addressing "do not have to build with those dangerous
> options”.


Sure, we could add -O or another runtime enabler,
or could force UpgradeTVDatabaseSchema() and friends to alert the user?


From memory, I think the original intent of the IGNORE_ hack
was to allow _quick_ build/run/debug against a mismatched DB.
I think the automatic DB backup stuff was added just after this,
to make the “weapon” less dangerous.



--
Nigel Pearson, nigel@ind.tansu.com.au|"Your face looks like it was
Telstra Voice/Vid, Sydney, Australia | hit with a Prius. And your
Office: 8576 5449 Fax: 9298 9033 | Prius looks like it was hit
Mobile: 0408 664435 Home: 9792 6998 | with a telephone pole!”
Re: [mythtv-commits] Ticket #13261: Better solution for schema or protocol mismatch [ In reply to ]
On Mon, Apr 30, 2018 at 12:04:50PM -0500, David Engel wrote:
> On Mon, Apr 30, 2018 at 06:57:52PM +0200, Jean-Yves Avenard wrote:
> > Hi
> >
> > > On 30 Apr 2018, at 6:28 pm, Michael T. Dean <mtdean@thirdcontact.com> wrote:
> > >
> > > And, of course, protocol version independence is simply an issue of coding every communications point to have resiliency/error checking and/or coding support for every known (or supported) protocol version (to achieve backwards compatibility). In fact, this is actually part of the above database-schema-version-independence solution--if we simply change all data access to be done through a data server to which we communicate through some protocol version and code for data resiliency.
> > >
> > > Mike
> >
> > Fully agree with Mike..
> >
> > those should *not* be made user configurable prefs.
>
> <me-too/>

Further clarification: I'm still very much in favor of converting
nearly all frontend interaction with the backends to use API calls
*and* to begin supporting some backward compatibility there.

David
--
David Engel
david@istwok.net
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org