Commit Graph

64 Commits

Author SHA1 Message Date
Alexey Milovidov
74e1f4dc61 Fix clang-tidy 2022-08-20 17:09:20 +02:00
Alexander Tokmakov
a1ca690afb
Merge pull request #37976 from ClickHouse/tavplubix-patch-1
Try fix `test_consistent_parts_after_clone_replica`
2022-06-10 21:04:56 +03:00
Alexander Tokmakov
2319ef7647 fix test 2022-06-10 17:48:14 +02:00
Robert Schulze
1a0b5f33b3
More consistent use of platform macros
cmake/target.cmake defines macros for the supported platforms, this
commit changes predefined system macros to our own macros.

__linux__ --> OS_LINUX
__APPLE__ --> OS_DARWIN
__FreeBSD__ --> OS_FREEBSD
2022-06-10 10:22:31 +02:00
Alexander Tokmakov
12bbb7de87 fix race on TID allocation 2022-05-20 12:41:44 +02:00
Robert Schulze
e3cfec5b09
Merge remote-tracking branch 'origin/master' into clangtidies 2022-05-16 10:12:50 +02:00
Robert Schulze
1b81bb49b4
Enable clang-tidy modernize-deprecated-headers & hicpp-deprecated-headers
Official docs:

  Some headers from C library were deprecated in C++ and are no longer
  welcome in C++ codebases. Some have no effect in C++. For more details
  refer to the C++ 14 Standard [depr.c.headers] section. This check
  replaces C standard library headers with their C++ alternatives and
  removes redundant ones.
2022-05-09 08:23:33 +02:00
Alexey Milovidov
7841f02cf0 Remove nested exception 2022-05-05 23:05:52 +02:00
Alexander Tokmakov
94af11dd74 add extra info when sending exception 2022-05-03 15:13:47 +02:00
Amos Bird
4a5e4274f0
base should not depend on Common 2022-04-29 10:26:35 +08:00
Anton Popov
d4df38a0e6 fix tests 2022-04-20 14:13:04 +00:00
Anton Popov
bee4ca9b62 add more tests for error diagnostics in files 2022-04-19 15:56:34 +00:00
Anton Popov
2de6668b3f show names of erroneous files 2022-04-16 00:10:47 +00:00
Maksim Kita
e7772ed434 Fix clang-tidy warnings in Common folder 2022-03-14 18:17:35 +00:00
Azat Khuzhin
cb70544dfe Move LockMemoryExceptionInThread and MemoryTrackerBlockerInThread 2022-01-10 22:39:10 +03:00
Alexandre Snarskii
c36c64a9a0 more corrections for disk size calculations 2021-11-09 12:28:59 +03:00
Alexey Milovidov
8b4a6a2416 Remove cruft 2021-10-28 02:10:39 +03:00
Alexey Milovidov
fe6b7c77c7 Rename "common" to "base" 2021-10-02 10:13:14 +03:00
Alexander Tokmakov
3bca886174 remove some trash 2021-09-17 22:29:10 +03:00
Raúl Marín
75d18bc79b CI linters and compiler errors 2021-07-27 16:29:34 +02:00
Raúl Marín
efe1938437 WIP: Slow improvements 2021-07-27 16:26:29 +02:00
Alexey Milovidov
588c31d9f5 Better messages 2021-07-10 11:18:06 +03:00
Alexey Milovidov
1f91c65aca Add error id to exceptions 2021-07-10 05:43:53 +03:00
tavplubix
e9ff0b6d70
Merge pull request #23657 from kssenii/poco-file-to-std-fs
Poco::File to std::filesystem
2021-05-31 23:17:02 +03:00
alesapin
945050fe7c Block allocator earlier in 2021-05-28 17:34:16 +03:00
kssenii
b123ec1354 Poco::FileException, Poco::parentPath 2021-05-14 00:20:28 +03:00
kssenii
35f999bf04 Poco::createFile to fs::createFile 2021-05-08 02:41:47 +03:00
Azat Khuzhin
22d394c4a3 Block all memory tracking limits in tryLogCurrentException() 2021-04-14 23:38:41 +03:00
Nikolai Kochetov
f164c2462f
Update Exception.cpp
Fix build
2021-03-24 09:41:57 +03:00
Azat Khuzhin
7c07b43597 Convert system.errors.stack_trace from String into Array(UInt64)
This should decrease overhead for the errors collecting.
2021-03-24 06:52:48 +03:00
Azat Khuzhin
44c9dc753d Add system.errors.last_error_stacktrace column 2021-03-16 22:31:49 +03:00
Azat Khuzhin
775f8f7682 Add system.errors.last_error_message column 2021-03-16 22:31:49 +03:00
Azat Khuzhin
259e5ba88e Separate accounting of remote exceptions in system.errors 2021-03-16 22:31:46 +03:00
Azat Khuzhin
e7948819f9 Fix ParsingException::displayText()
Before it was silently try-catched for messages with additional {}, and
it is very easy to trigger, i.e.:

    SELECT toDateTime(format('{}-{}-01 00:00:00', '2021', '1'))

Will print:

    Code: 41. DB::Exception: Received from localhost:9000. DB::Exception: Cannot parse datetime 2021-1-01 00:00:00{}: Cannot parse DateTime from String: while executing 'FUNCTION toDateTime(format('{}-{}-01 00:00:00', '2021', '1') :: 3) -> toDateTime(format('{}-{}-01 00:00:00', '2021', '1')) DateTime : 2'.
2021-03-03 23:44:51 +03:00
Azat Khuzhin
89c4055202 Lock MEMORY_LIMIT_EXCEEDED error from tryLogCurrentException()
This will avoid hiding some exceptions in logs, when the server is under
high memory pressure (i.e. when any new allocation will lead to
MEMORY_LIMIT_EXCEEDED error).

This became more relevent after all memory allocations was tracked with
MemoryTracker, by falling back to total_memory_tracking, in #16121
2021-01-29 21:38:14 +03:00
Azat Khuzhin
e4350e078c Add ability to distinguish remote exceptions from local 2021-01-20 01:10:17 +03:00
Nikita Mikhailov
84d0084c1a style 2020-12-23 01:33:07 +03:00
nikitamikhaylov
6f30fae34e final fix 2020-12-23 01:02:45 +03:00
Pavel Kovalenko
3f2f663bfa Add [[maybe_unused]] for msg parameter in handle_error_code. 2020-12-12 17:43:11 +03:00
Pavel Kovalenko
25df6bae78 Add nested exception when handle Disk S3 metadata file read error. 2020-12-12 17:11:47 +03:00
Alexander Tokmakov
b94cc5c4e5 remove more stringstreams 2020-11-10 21:22:26 +03:00
Alexey Milovidov
fd84d16387 Fix "server failed to start" error 2020-11-07 03:14:53 +03:00
Azat Khuzhin
cb50886ef1 Fix ErrorCodes increment on error 2020-10-29 21:24:52 +03:00
Azat Khuzhin
b42f77a791 Covert error codes list to lookup table and drop generation of them. 2020-10-29 10:55:41 +03:00
Azat Khuzhin
b2e2322895 Add system.errors table
Contains error codes with number of times they have been triggered.

Columns:

-   `name` ([String](../../sql-reference/data-types/string.md)) — name of the error (`errorCodeToName`).
-   `code` ([Int32](../../sql-reference/data-types/int-uint.md)) — code number of the error.
-   `value` ([UInt64](../../sql-reference/data-types/int-uint.md)) - number of times this error has been happened.

**Example**

``` sql
SELECT *
FROM system.errors
WHERE value > 0
ORDER BY code ASC
LIMIT 1

┌─name─────────────┬─code─┬─value─┐
│ CANNOT_OPEN_FILE │   76 │     1 │
└──────────────────┴──────┴───────┘
2020-10-29 10:55:38 +03:00
Alexander Tokmakov
026896835c fixes 2020-10-16 15:20:30 +03:00
Alexander Tokmakov
95ad45a3b0 minor improvements of stress test 2020-10-15 21:14:04 +03:00
Alexander Tokmakov
59d879b1fe fix "no space left" extra info for Poco::Exception 2020-08-25 18:06:24 +03:00
Max Akhmedov
026cb4ac1b
Demangle exception classname for std::exception 2020-08-07 17:52:32 +03:00
Alexey Milovidov
475af33319 Avoid too large stack frames 2020-06-08 20:35:45 +03:00