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

roachtest: backup: use AOST time slightly in the past #35359

Merged
merged 1 commit into from
Mar 7, 2019
Merged

roachtest: backup: use AOST time slightly in the past #35359

merged 1 commit into from
Mar 7, 2019

Conversation

maddyblue
Copy link
Contributor

Avoids problems where it's sometimes in the future according to the
AOST logic.

Fixes #34817

Release note: None

Avoids problems where it's sometimes in the future according to the
AOST logic.

Fixes #34817

Release note: None
@maddyblue maddyblue requested review from dt and danhhz March 4, 2019 20:23
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@vivekmenezes
Copy link
Contributor

I've seen some other roachtests that are failing with the same error. Do you know which change caused this problem.

@maddyblue
Copy link
Contributor Author

I think it was #34547 which changed what the max time is.

@vivekmenezes
Copy link
Contributor

I'm seeing a similar failure in #34922 (comment)

I suspect it's being cuased by using Now() in https://github.com/cockroachdb/cockroach/blob/master/pkg/sql/conn_executor_exec.go#L597
in the call just prior to that one we use OrigTimestamp().

@ajwerner any thoughts on this?

@ajwerner
Copy link
Contributor

ajwerner commented Mar 5, 2019

Yes it does seem that the recent change is causing the problems. The code in #34547 makes AOST evaluation relevant to the stmt time and enforces that it proceeds that time by at least 1us. One easy way to enforce that you get a near real time value that is safe is to use a relative AOST specifier rather than an exact one. I'd recommend using '-1us' instead of rendering a go timestamp to a string.

@vivekmenezes
Copy link
Contributor

@ajwerner I can either use the statement timestamp or a timestamp less by at least-1us right?

@ajwerner
Copy link
Contributor

ajwerner commented Mar 5, 2019

@ajwerner I can either use the statement timestamp or a timestamp less by at least-1us right?

Correct, if you pass a timestamp which is parsed by ParseDTimestamp that is not after the statement timestamp then it should be fine. It is interesting that you were able to create a time before issuing the query that created a value after the statement timestamp. It may have something to do with the resolution of the timestamp string. If you passed the timestamp in Decimal HLC format it should have sufficient resolution.

@vivekmenezes
Copy link
Contributor

@ajwerner hmmm perhaps it's https://github.com/cockroachdb/cockroach/blob/master/pkg/sql/conn_executor_exec.go#L563 then that uses the txn timestamp . I believe we do this to prevent clock uncertainty from pushing the txn. Perhaps I need to rethink using AOST for this use case. But could that be the problem?

@ajwerner
Copy link
Contributor

ajwerner commented Mar 5, 2019

@ajwerner hmmm perhaps it's https://github.com/cockroachdb/cockroach/blob/master/pkg/sql/conn_executor_exec.go#L563 then that uses the txn timestamp . I believe we do this to prevent clock uncertainty from pushing the txn. Perhaps I need to rethink using AOST for this use case. But could that be the problem?

That shouldn't be the problem as the txn's timestamp should be before or equal to the statement timestamp. Furthermore, now that I've looked at the serialization, it seems to use the decimal HLC form. I'm honestly confused as to the source of the problem. I'll keep digging.

@vivekmenezes
Copy link
Contributor

#27688 (comment) is another roachtest failure.

@ajwerner
Copy link
Contributor

ajwerner commented Mar 5, 2019

} else if stmtTimestamp.Before(ts.GoTime()) {
that's the check

@maddyblue
Copy link
Contributor Author

The -1us technique won't work for this test because it needs to do an AOST query later to compare the backup results to the query, thus it needs a specific time, not a relative time. Can someone LGTM this or suggest a better way?

Copy link
Contributor

@ajwerner ajwerner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @danhhz and @dt)

@maddyblue
Copy link
Contributor Author

bors r+

craig bot pushed a commit that referenced this pull request Mar 7, 2019
35091: sql: rearchitecture ALTER TABLE RENAME, add support for renaming constraints r=knz a=knz

Fixes #32555. For TypeORM compat, see discussion on #22298.

Release note (sql change): This patch changes RENAME COLUMN to become
a "table command", which can be used alongside other table commands in
a single ALTER TABLE statement. This makes it possible to e.g. atomically
add a computed column based on an existing column, and rename the
columns so that the computed column "replaces" the original column.

Release note (sql change): CockroachDB now supports ALTER TABLE RENAME
CONSTRAINT for compatibility with PostgreSQL. This feature is limited
to *named* constraints, where the name of the constraints is preserved
in the table metadata. This currently includes CHECK, UNIQUE and
FOREIGN KEY constraints, and does not include other
constraints (DEFAULT, NULL etc) otherwise supported by PostgreSQL. For
UNIQUE constraint, only supporting indexes that are not depended on by
views can be renamed.

35121: sql: add support for pg_catalog.{current_setting,set_config} r=knz a=knz

Fixes #35108. Needed for Flowable compatibility.

Release note (sql change): The SQL built-in functions
`pg_catalog.current_setting()` and `pg_catalog.set_config()` are now
supported for compatibility with PostgreSQL. Note that only
session-scoped configuration changes remain supported (`set_config(_,
_, false)`).

35359: roachtest: backup: use AOST time slightly in the past r=mjibson a=mjibson

Avoids problems where it's sometimes in the future according to the
AOST logic.

Fixes #34817

Release note: None

35371: sql: ensure column constraints are validated after SET for UPSERT r=knz a=knz

Fixes #35040.

Release note (bug fix): CockroachDB now properly applies column width
and nullability constraints on the result of conflict resolution in
UPSERT and INSERT ON CONFLICT.

Co-authored-by: Raphael 'kena' Poss <knz@cockroachlabs.com>
Co-authored-by: Matt Jibson <matt.jibson@gmail.com>
@craig
Copy link
Contributor

craig bot commented Mar 7, 2019

Build succeeded

@craig craig bot merged commit a5eae72 into cockroachdb:master Mar 7, 2019
@maddyblue maddyblue deleted the asof-backup branch March 7, 2019 19:44
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

Successfully merging this pull request may close these issues.

4 participants